-
-
Notifications
You must be signed in to change notification settings - Fork 3
Revert "fix: Make CI works for external contributors" #509
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 all commits
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 |
|---|---|---|
|
|
@@ -28,31 +28,17 @@ jobs: | |
| platforms: linux/${{ matrix.platform }} | ||
| dockerfile_path: './Dockerfile' | ||
| build_args: TASKBROKER_GIT_REVISION=${{ github.sha }} | ||
| ghcr: ${{ github.event.pull_request.head.repo.fork == false }} | ||
| ghcr: true | ||
| tag_suffix: -${{ matrix.platform }} | ||
| publish_on_pr: true | ||
| google_ar: false | ||
| tag_nightly: false | ||
| tag_latest: false | ||
| tags: ${{ github.event_name == 'pull_request' && 'ghcr.io/getsentry/taskbroker:nightly' || ''}} | ||
| outputs: ${{ github.event_name == 'pull_request' && 'type=docker' || ''}} | ||
|
|
||
| - name: Save Docker image to artifact | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| run: docker save -o /tmp/taskbroker.tar ghcr.io/getsentry/taskbroker:nightly | ||
|
|
||
| - name: Upload artifact for self-hosted e2e | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| with: | ||
| name: taskbroker-${{ matrix.platform }} | ||
| path: /tmp/taskbroker.tar | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
|
|
||
| assemble-taskbroker-image: | ||
| runs-on: ubuntu-latest | ||
| needs: [build] | ||
| if: ${{ (github.ref_name == 'main' || startsWith(github.ref_name, 'releases/')) && github.event_name != 'pull_request' }} | ||
|
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. Bug: E2E job skips for all pull requests because its dependency 🔍 Detailed AnalysisThe 💡 Suggested FixModify the 🤖 Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
@@ -67,7 +53,6 @@ jobs: | |
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | ||
|
|
||
| - name: Create multiplatform manifests | ||
| if: ${{ (github.ref_name == 'main' || startsWith(github.ref_name, 'releases/')) && github.event_name != 'pull_request' }} | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| --tag ghcr.io/getsentry/taskbroker:${{ github.event.pull_request.head.sha || github.sha }} \ | ||
|
|
@@ -106,19 +91,6 @@ jobs: | |
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - name: Download artifact for pull request | ||
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| with: | ||
| name: taskbroker-amd64 | ||
| path: /tmp/ | ||
|
|
||
| - name: Load Docker image from tar file | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| run: | | ||
| docker image load --input /tmp/taskbroker.tar | ||
| docker image tag ghcr.io/getsentry/taskbroker:nightly ghcr.io/getsentry/taskbroker:${{ github.sha }} | ||
|
|
||
| - name: Run Sentry self-hosted e2e CI | ||
| uses: getsentry/self-hosted@master | ||
| with: | ||
|
|
||
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.
Bug: Hardcoding
ghcr: truecauses 403 Forbidden errors when pushing images from fork pull requests due to insufficientGITHUB_TOKENpermissions.Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The change to
ghcr: trueat.github/workflows/image.yml:31forces the action to attempt pushing images to GHCR for all pull requests. For pull requests originating from forks, theGITHUB_TOKENlacks the necessary permissions to push to the upstream organization's GHCR registry, resulting in a 403 Forbidden error. This prevents the CI workflow from completing successfully for external contributions.💡 Suggested Fix
Reintroduce the conditional
ghcr: ${{ github.event.pull_request.head.repo.fork == false }}to prevent pushing to GHCR for fork pull requests. Restore the artifact saving/loading mechanism for PRs.🤖 Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.