@@ -79,14 +79,14 @@ jobs:
79
79
# required
80
80
app-id: ${{ vars.APP_ID }}
81
81
private-key: ${{ secrets.PRIVATE_KEY }}
82
- - name: Retrieve GitHub App User ID
82
+ - name: Get GitHub App User ID
83
83
id: get-user-id
84
- run: echo "user-id=$(gh api "/users/${{ steps.generate -token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
84
+ run: echo "user-id=$(gh api "/users/${{ steps.app -token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
85
85
env:
86
86
GH_TOKEN: ${{ steps.app-token.outputs.token }}
87
87
- id: committer
88
- run: echo "string=${{steps.app-token.outputs.app-slug}}[bot] <${{steps.get-user-id.outputs.user-id}}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"
89
- - run: echo "committer string is ${{steps.committer.outputs.string}}"
88
+ run: echo "string=${{ steps.app-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"
89
+ - run: echo "committer string is ${ {steps.committer.outputs.string }}"
90
90
` ` `
91
91
92
92
# ## Configure git CLI for an app's bot user
@@ -104,23 +104,27 @@ jobs:
104
104
# required
105
105
app-id: ${{ vars.APP_ID }}
106
106
private-key: ${{ secrets.PRIVATE_KEY }}
107
- - name: Retrieve GitHub App User ID
107
+ - name: Get GitHub App User ID
108
108
id: get-user-id
109
- run: echo "user-id=$(gh api "/users/${{ steps.generate -token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
109
+ run: echo "user-id=$(gh api "/users/${{ steps.app -token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
110
110
env:
111
111
GH_TOKEN: ${{ steps.app-token.outputs.token }}
112
112
- run: |
113
- git config --global user.name '${{steps.app-token.outputs.app-slug}}[bot]'
114
- git config --global user.email '${{steps.get-user-id.outputs.user-id}}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
113
+ git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
114
+ git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
115
115
# git commands like commit work using the bot user
116
116
- run: |
117
117
git add .
118
118
git commit -m "Auto-generated changes"
119
119
git push
120
120
` ` `
121
121
122
- The `<BOT USER ID>` is the numeric user ID of the app's bot user, which can be found under `https://api.github.com/users/<app-slug>%5Bbot%5D`.
123
- For example, we can check at `https://api.github.com/users/dependabot%5Bbot%5D` to see the user ID of dependabot is 49699333.
122
+ > [!TIP]
123
+ > The `<BOT USER ID>` is the numeric user ID of the app's bot user, which can be found under `https://api.github.com/users/<app-slug>%5Bbot%5D`.
124
+ >
125
+ > For example, we can check at `https://api.github.com/users/dependabot[bot]` to see the user ID of Dependabot is 49699333.
126
+ >
127
+ > Alternatively, you can use the [octokit/request-action](https://github.com/octokit/request-action) to get the ID.
124
128
125
129
# ## Create a token for all repositories in the current owner's installation
126
130
@@ -203,7 +207,7 @@ jobs:
203
207
set-matrix:
204
208
runs-on: ubuntu-latest
205
209
outputs:
206
- matrix: ${{steps.set.outputs.matrix }}
210
+ matrix: ${{ steps.set.outputs.matrix }}
207
211
steps:
208
212
- id: set
209
213
run: echo 'matrix=[{"owner":"owner1"},{"owner":"owner2","repos":["repo1"]}]' >>"$GITHUB_OUTPUT"
0 commit comments