Skip to content

Commit 3962604

Browse files
committed
ci(workflows): Streamline GitHub token generation across workflows
1 parent d6418ff commit 3962604

File tree

3 files changed

+12
-33
lines changed

3 files changed

+12
-33
lines changed

.github/workflows/gittools-actions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ jobs:
3535
"version=$version" >> $env:GITHUB_OUTPUT
3636
-
3737
name: Load GitHub App credentials
38-
id: gh-app-creds
39-
uses: gittools/cicd/gh-app-creds@v1
38+
id: github-app-creds
39+
uses: gittools/cicd/github-app-creds@v1
4040
with:
4141
op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
4242
-
4343
name: Generate GitHub App Token
4444
id: app-token
4545
uses: actions/create-github-app-token@v3
4646
with:
47-
app-id: ${{ steps.gh-app-creds.outputs.gh_app_id }}
48-
private-key: ${{ steps.gh-app-creds.outputs.gh_app_private_key }}
47+
app-id: ${{ steps.github-app-creds.outputs.gh_app_id }}
48+
private-key: ${{ steps.github-app-creds.outputs.gh_app_private_key }}
4949
owner: ${{ github.repository_owner }}
5050
repositories: actions
5151
permission-contents: write

.github/workflows/homebrew.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,11 @@ jobs:
3030
}
3131
"version=$version" >> $env:GITHUB_OUTPUT
3232
-
33-
name: Load GitHub App credentials
34-
id: gh-app-creds
35-
uses: gittools/cicd/gh-app-creds@v1
33+
name: Load GitHub release token
34+
id: github-creds
35+
uses: gittools/cicd/github-creds@v1
3636
with:
3737
op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
38-
-
39-
name: Generate GitHub App Token
40-
id: app-token
41-
uses: actions/create-github-app-token@v3
42-
with:
43-
app-id: ${{ steps.gh-app-creds.outputs.gh_app_id }}
44-
private-key: ${{ steps.gh-app-creds.outputs.gh_app_private_key }}
45-
owner: gittools-bot
46-
repositories: homebrew-core
47-
permission-contents: write
48-
permission-pull-requests: write
4938
-
5039
uses: mislav/bump-homebrew-formula-action@v3
5140
name: Bump Homebrew formula
@@ -59,4 +48,4 @@ jobs:
5948
6049
For additional details see https://github.com/GitTools/GitVersion/releases/tag/${{ steps.get-version.outputs.version }}
6150
env:
62-
COMMITTER_TOKEN: ${{ steps.app-token.outputs.token }}
51+
COMMITTER_TOKEN: ${{ steps.github-creds.outputs.github_release_token }}

.github/workflows/winget.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,11 @@ jobs:
1717
name: Bump winget manifest
1818
runs-on: ubuntu-24.04
1919
steps:
20-
- name: Load GitHub App credentials
21-
id: gh-app-creds
22-
uses: gittools/cicd/gh-app-creds@v1
20+
- name: Load GitHub release token
21+
id: github-creds
22+
uses: gittools/cicd/github-creds@v1
2323
with:
2424
op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
25-
- name: Generate GitHub App Token
26-
id: app-token
27-
uses: actions/create-github-app-token@v3
28-
with:
29-
app-id: ${{ steps.gh-app-creds.outputs.gh_app_id }}
30-
private-key: ${{ steps.gh-app-creds.outputs.gh_app_private_key }}
31-
owner: gittools-bot
32-
repositories: winget-pkgs
33-
permission-contents: write
34-
permission-pull-requests: write
3525
- name: Get version
3626
id: get-version
3727
shell: pwsh
@@ -50,7 +40,7 @@ jobs:
5040
5141
- uses: michidk/run-komac@v2.1.0
5242
env:
53-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
43+
GITHUB_TOKEN: ${{ steps.github-creds.outputs.github_release_token }}
5444
with:
5545
args: '${{ steps.get-version.outputs.run_args }}'
5646
custom-fork-owner: gittools-bot

0 commit comments

Comments
 (0)