@@ -43,21 +43,34 @@ jobs:
43
43
workflow_run_url : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
44
44
45
45
steps :
46
+ - name : Create GitHub App token
47
+ uses : actions/create-github-app-token@v2
48
+ id : app-token
49
+ with :
50
+ app-id : ${{ vars.CI_APP_ID }}
51
+ private-key : ${{ secrets.CI_APP_PRIVATE_KEY }}
52
+
53
+ - name : Get GitHub App User ID
54
+ id : user-id
55
+ run : echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
56
+ env :
57
+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
58
+
59
+ - name : Configure git
60
+ run : |
61
+ git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
62
+ git config --global user.email '${{ steps.user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
63
+
46
64
- name : Checkout repository
47
65
uses : actions/checkout@v4
48
66
with :
49
- ssh-key : ${{ secrets.CI_UPDATE_SSH_KEY }}
67
+ token : ${{ steps.app-token.outputs.token }}
50
68
51
69
- name : Install Nix
52
70
uses : cachix/install-nix-action@v31
53
71
with :
54
72
nix_path : nixpkgs=channel:nixos-unstable
55
- github_access_token : ${{ secrets.GITHUB_TOKEN }}
56
-
57
- - name : Configure git
58
- run : |
59
- git config user.name 'github-actions[bot]'
60
- git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
73
+ github_access_token : ${{ steps.app-token.outputs.token }}
61
74
62
75
- name : Create update branch
63
76
run : |
67
80
- name : Get info on the current PR
68
81
id : open_pr_info
69
82
env :
70
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
83
+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
71
84
run : |
72
85
# Query for info about the already open update PR
73
86
info=$(
@@ -179,7 +192,7 @@ jobs:
179
192
id : updated_pr
180
193
if : steps.diff.outputs.count
181
194
env :
182
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
195
+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
183
196
pr_num : ${{ steps.open_pr_info.outputs.number }}
184
197
title : |
185
198
[${{ github.ref_name }}] Update flake.lock & generated files
0 commit comments