Skip to content

Commit 3fac098

Browse files
committed
Adds GitHub App authentication for repository access
Configures the workflow to use a GitHub App token for repository access, allowing actions to operate with the App's permissions instead of the default GITHUB_TOKEN. This enables more granular control over permissions and prevents rate limiting issues when performing actions on multiple repositories. It also allows the workflow to access private submodules.
1 parent 0a0612b commit 3fac098

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/_cloudflare-r2-release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,22 @@ jobs:
470470
outputs:
471471
release_url: ${{ steps.release.outputs.html_url }}
472472
release_id: ${{ steps.release.outputs.id }}
473-
473+
474474
steps:
475+
- name: Generate GitHub App Token
476+
id: app-token
477+
if: inputs.github_app_auth != false
478+
uses: actions/create-github-app-token@v2
479+
with:
480+
app-id: ${{ secrets.app_id }}
481+
private-key: ${{ secrets.app_pem }}
482+
repositories: ${{ inputs.github_app_repos }}
483+
475484
- name: Checkout repository
476485
uses: actions/checkout@v4
486+
with:
487+
submodules: ${{ inputs.checkout_submodules }}
488+
token: ${{ steps.app-token.outputs.token || github.token }}
477489

478490
- name: Download all artifacts
479491
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)