-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ci: Add GitHub App authentication support to review action #8368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
135f762
70e756f
9bc8000
d146aea
7000ec5
926349f
41c4185
9f53c16
c2961c3
77b4c8c
1a77ffa
99ed499
517323f
ef43cf5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,9 +20,17 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Generate GitHub App Token | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step always invokes create-github-app-token with required inputs, so runs without App credentials now fail instead of falling back to the default GITHUB_TOKEN. Please make the step conditional (and keep the original token path) so workflows without secrets still succeed. Prompt for AI agents✅ Addressed in |
||
| id: generate-token | ||
| uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v2.0.0 | ||
| with: | ||
| app-id: ${{ secrets.CONTINUE_APP_ID }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Please source the app ID from `vars.CONTINUE_APP_ID`; using the secrets context leaves this input blank here, so the generated token step fails to authenticate the app. (Based on your team's feedback about sourcing APP_ID from GitHub Actions variables instead of secrets.)
Prompt for AI agents~~~ Address the following comment on .github/workflows/continue-general-review.yaml at line 28: Please source the app ID from `vars.CONTINUE_APP_ID`; using the secrets context leaves this input blank here, so the generated token step fails to authenticate the app. (Based on your team's feedback about sourcing APP_ID from GitHub Actions variables instead of secrets.) @@ -20,9 +20,18 @@ jobs: + uses: actions/create-github-app-token@5d869da # v2.0.0 + if: secrets.CONTINUE_APP_ID != '' && secrets.CONTINUE_APP_PRIVATE_KEY != '' + with: + app-id: ${{ secrets.CONTINUE_APP_ID }} + private-key: ${{ secrets.CONTINUE_APP_PRIVATE_KEY }} + ~~~
bdougie marked this conversation as resolved.
Outdated
|
||
| private-key: ${{ secrets.CONTINUE_APP_PRIVATE_KEY }} | ||
|
|
||
| - name: Run Continue PR Review Action | ||
| uses: continuedev/continue/actions/general-review@main | ||
| with: | ||
| continue-api-key: ${{ secrets.CONTINUE_API_KEY }} | ||
| continue-org: "continuedev" | ||
| continue-agent: "empty-agent" | ||
| github-token: ${{ steps.generate-token.outputs.token }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,9 @@ inputs: | |
| continue-agent: | ||
| description: 'Agent path to use (e.g., "myorg/review-bot")' | ||
| required: true | ||
| github-token: | ||
| description: "GitHub token for API access" | ||
| required: true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Requiring the new github-token input breaks existing workflows that call this action without it. Keep the input optional and explicitly fall back to github.token so current users remain compatible. Prompt for AI agents✅ Addressed in |
||
|
|
||
| runs: | ||
| using: "composite" | ||
|
|
@@ -23,6 +26,7 @@ runs: | |
| id: auth-check | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ inputs.github-token }} | ||
| script: | | ||
| let shouldRun = false; | ||
| let skipReason = ''; | ||
|
|
@@ -120,6 +124,7 @@ runs: | |
| id: initial-comment | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ inputs.github-token }} | ||
| script: | | ||
| const marker = '<!-- continue-agent-review -->'; | ||
|
|
||
|
|
@@ -205,7 +210,7 @@ runs: | |
| if: env.SHOULD_RUN == 'true' | ||
| shell: bash | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| GITHUB_TOKEN: ${{ inputs.github-token }} | ||
| run: | | ||
| # Get PR number based on event type | ||
| if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
|
|
@@ -228,7 +233,7 @@ runs: | |
| CONTINUE_API_KEY: ${{ inputs.continue-api-key }} | ||
| CONTINUE_ORG: ${{ inputs.continue-org }} | ||
| CONTINUE_AGENT: ${{ inputs.continue-agent }} | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| GITHUB_TOKEN: ${{ inputs.github-token }} | ||
| run: | | ||
| echo "Running Continue CLI with prompt:" | ||
| echo "==================================" | ||
|
|
@@ -339,6 +344,7 @@ runs: | |
| if: env.SHOULD_RUN == 'true' && always() | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ inputs.github-token }} | ||
| script: | | ||
| const fs = require('fs'); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step needs an if condition so it only runs when both app credentials are present; otherwise the action fails instead of falling back to the default GITHUB_TOKEN.
Prompt for AI agents
✅ Addressed in
926349f