mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
ci/update: use nix-community GitHub App
(cherry picked from commit ad7e489aa1
)
This commit is contained in:
parent
6ef96cb478
commit
240a7c2fdf
1 changed files with 22 additions and 9 deletions
31
.github/workflows/update.yml
vendored
31
.github/workflows/update.yml
vendored
|
@ -47,21 +47,34 @@ jobs:
|
||||||
workflow_run_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
workflow_run_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Create GitHub App token
|
||||||
|
uses: actions/create-github-app-token@v2
|
||||||
|
id: app-token
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.CI_APP_ID }}
|
||||||
|
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Get GitHub App User ID
|
||||||
|
id: user-id
|
||||||
|
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Configure git
|
||||||
|
run: |
|
||||||
|
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
|
||||||
|
git config --global user.email '${{ steps.user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ssh-key: ${{ secrets.CI_UPDATE_SSH_KEY }}
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v31
|
uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
github_access_token: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
- name: Configure git
|
|
||||||
run: |
|
|
||||||
git config user.name 'github-actions[bot]'
|
|
||||||
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
||||||
|
|
||||||
- name: Create update branch
|
- name: Create update branch
|
||||||
run: |
|
run: |
|
||||||
|
@ -71,7 +84,7 @@ jobs:
|
||||||
- name: Get info on the current PR
|
- name: Get info on the current PR
|
||||||
id: open_pr_info
|
id: open_pr_info
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
# Query for info about the already open update PR
|
# Query for info about the already open update PR
|
||||||
info=$(
|
info=$(
|
||||||
|
@ -205,7 +218,7 @@ jobs:
|
||||||
id: updated_pr
|
id: updated_pr
|
||||||
if: steps.diff.outputs.count
|
if: steps.diff.outputs.count
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
pr_num: ${{ steps.open_pr_info.outputs.number }}
|
pr_num: ${{ steps.open_pr_info.outputs.number }}
|
||||||
title: |
|
title: |
|
||||||
[${{ github.ref_name }}] Update flake.lock & generated files
|
[${{ github.ref_name }}] Update flake.lock & generated files
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue