Skip to content

Commit cf32734

Browse files
committed
use gh app to fetch token for docs pr creation
1 parent 2fc92bd commit cf32734

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

.github/workflows/update-metadata.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,27 @@ on:
1212
branches:
1313
- main
1414

15+
permissions: read-all
16+
1517
jobs:
18+
get-token:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
generated_token: ${{ steps.app-token.outputs.token }}
22+
steps:
23+
- name: Generate Token
24+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
25+
id: app-token
26+
with:
27+
app-id: ${{ vars.METADATA_SYNC_APP_ID }}
28+
private-key: ${{ secrets.METADATA_SYNC_PRIVATE_KEY }}
29+
1630
update-metadata:
31+
needs: get-token
1732
uses: validatedpatterns/docs/.github/workflows/metadata-docs.yml@main # zizmor: ignore[unpinned-uses]
18-
permissions: # Workflow-level permissions
19-
contents: read # Required for "read-all"
20-
packages: write # Allows writing to packages
21-
id-token: write # Allows creating OpenID Connect (OIDC) tokens
33+
permissions:
34+
contents: read
35+
packages: write
36+
id-token: write
2237
secrets:
23-
DOCS_TOKEN: ${{ secrets.DOCS_TOKEN }}
24-
# For testing you can point to a different branch in the docs repository
25-
# with:
26-
# DOCS_BRANCH: "main"
38+
DOCS_TOKEN: ${{ needs.get-token.outputs.generated_token }}

0 commit comments

Comments
 (0)