From 822391fb1d054a9e4d35802ea538b719e62da837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=99=E6=BC=A0=E4=B9=8B=E5=AD=90?= <7850715+maboloshi@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:07:47 +0800 Subject: [PATCH 1/3] Update README.md --- README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3d3060d..071a139 100644 --- a/README.md +++ b/README.md @@ -79,14 +79,14 @@ jobs: # required app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.PRIVATE_KEY }} - - name: Retrieve GitHub App User ID + - name: Get GitHub App User ID id: get-user-id - run: echo "user-id=$(gh api "/users/${{ steps.generate-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" + 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 }} - id: committer - 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" - - run: echo "committer string is ${{steps.committer.outputs.string}}" + 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" + - run: echo "committer string is ${ {steps.committer.outputs.string }}" ``` ### Configure git CLI for an app's bot user @@ -104,14 +104,14 @@ jobs: # required app-id: ${{ vars.APP_ID }} private-key: ${{ secrets.PRIVATE_KEY }} - - name: Retrieve GitHub App User ID + - name: Get GitHub App User ID id: get-user-id - run: echo "user-id=$(gh api "/users/${{ steps.generate-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" + 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 }} - run: | - git config --global user.name '${{steps.app-token.outputs.app-slug}}[bot]' - git config --global user.email '${{steps.get-user-id.outputs.user-id}}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>' + git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' + git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>' # git commands like commit work using the bot user - run: | git add . @@ -119,8 +119,12 @@ jobs: git push ``` -The `` is the numeric user ID of the app's bot user, which can be found under `https://api.github.com/users/%5Bbot%5D`. -For example, we can check at `https://api.github.com/users/dependabot%5Bbot%5D` to see the user ID of dependabot is 49699333. +> [!TIP] +> The `` is the numeric user ID of the app's bot user, which can be found under `https://api.github.com/users/%5Bbot%5D`. +> +> For example, we can check at `https://api.github.com/users/dependabot%5Bbot%5D` to see the user ID of dependabot is 49699333. +> +> Similarly to get the id, you can also use the [octokit/request-action](https://github.com/octokit/request-action). ### Create a token for all repositories in the current owner's installation @@ -203,7 +207,7 @@ jobs: set-matrix: runs-on: ubuntu-latest outputs: - matrix: ${{steps.set.outputs.matrix }} + matrix: ${{ steps.set.outputs.matrix }} steps: - id: set run: echo 'matrix=[{"owner":"owner1"},{"owner":"owner2","repos":["repo1"]}]' >>"$GITHUB_OUTPUT" From 07bb43d760db8ca66f0b260ce09dc96dd0e632f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=99=E6=BC=A0=E4=B9=8B=E5=AD=90?= <7850715+maboloshi@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:07:02 +0800 Subject: [PATCH 2/3] Update README.md Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 071a139..f0b0356 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ jobs: > [!TIP] > The `` is the numeric user ID of the app's bot user, which can be found under `https://api.github.com/users/%5Bbot%5D`. > -> For example, we can check at `https://api.github.com/users/dependabot%5Bbot%5D` to see the user ID of dependabot is 49699333. +> For example, we can check at `https://api.github.com/users/dependabot[bot]` to see the user ID of Dependabot is 49699333. > > Similarly to get the id, you can also use the [octokit/request-action](https://github.com/octokit/request-action). From d7ee7ac64747287c55ce42e57b4b2f91d151fd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=99=E6=BC=A0=E4=B9=8B=E5=AD=90?= <7850715+maboloshi@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:07:15 +0800 Subject: [PATCH 3/3] Update README.md Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0b0356..4e6e9ba 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ jobs: > > For example, we can check at `https://api.github.com/users/dependabot[bot]` to see the user ID of Dependabot is 49699333. > -> Similarly to get the id, you can also use the [octokit/request-action](https://github.com/octokit/request-action). +> Alternatively, you can use the [octokit/request-action](https://github.com/octokit/request-action) to get the ID. ### Create a token for all repositories in the current owner's installation