-
Notifications
You must be signed in to change notification settings - Fork 1
Fix issue with required check blocking merge #49
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -55,6 +55,7 @@ jobs: | |||||
| needs: | ||||||
| - get-values | ||||||
| - check-skip-duplicate | ||||||
| - lint | ||||||
| if: needs.check-skip-duplicate.outputs.should-run == 'true' | ||||||
| permissions: | ||||||
| id-token: write # needed to assume OIDC roles (e.g. for downloading from CodeArtifact) | ||||||
|
|
@@ -72,7 +73,7 @@ jobs: | |||||
| AWS_ACCOUNT_ID: "{% endraw %}{{ aws_production_account_id }}{% raw %}" | ||||||
| SHOW_PREVIEW_COMMENT_ON_PR: ${{ github.event_name == 'pull_request' }} | ||||||
|
|
||||||
| required-check: | ||||||
| workflow-summary: | ||||||
| runs-on: {% endraw %}{{ gha_linux_runner }}{% raw %} | ||||||
| timeout-minutes: {% endraw %}{{ gha_short_timeout_minutes }}{% raw %} | ||||||
| needs: | ||||||
|
|
@@ -81,21 +82,9 @@ jobs: | |||||
| - check-skip-duplicate | ||||||
| - pulumi-workflow | ||||||
| permissions: | ||||||
| statuses: write # needed for updating status on Dependabot PRs | ||||||
| statuses: write # needed for updating status on PRs | ||||||
| if: always() | ||||||
| steps: | ||||||
| - name: Set status for duplicate detection | ||||||
| if: needs.check-skip-duplicate.outputs.should-run != 'true' | ||||||
| env: | ||||||
| GH_TOKEN: ${{ github.token }} | ||||||
| run: | | ||||||
| gh api \ | ||||||
| -X POST -H "Accept: application/vnd.github.v3+json" \ | ||||||
| "/repos/${{ github.repository }}/statuses/${{ github.sha }}" \ | ||||||
| -f state=pending -f context="required-check" -f description="⏭️ Workflow skipped due to duplicate detection" | ||||||
| echo "⏭️ Workflow was skipped due to duplicate detection - status set to pending to block merge" | ||||||
| exit 0 | ||||||
|
|
||||||
| - name: fail if prior job failure | ||||||
| run: | | ||||||
| failure_pattern="^(failure|cancelled)$" | ||||||
|
|
@@ -109,15 +98,15 @@ jobs: | |||||
| fi | ||||||
| echo "✅ All jobs completed successfully or were skipped" | ||||||
|
|
||||||
| - name: Mark required-check as succeeded | ||||||
| if: needs.check-skip-duplicate.outputs.should-run == 'true' | ||||||
| - name: Mark the required-check as succeeded so the PR can be merged | ||||||
| if: ${{ github.event_name == 'pull_request' }} | ||||||
| env: | ||||||
| GH_TOKEN: ${{ github.token }} | ||||||
| run: | | ||||||
| gh api \ | ||||||
| -X POST -H "Accept: application/vnd.github.v3+json" \ | ||||||
| "/repos/${{ github.repository }}/statuses/${{ github.sha }}" \ | ||||||
| -f state=success -f context="required-check" -f description="✅ All required checks passed" \ | ||||||
| "${{ github.event.pull_request.statuses_url }}" \ | ||||||
|
||||||
| "${{ github.event.pull_request.statuses_url }}" \ | |
| "/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }}" \ |
Copilot
AI
Jan 27, 2026
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.
The description text "✅ All required checks passed in the job triggered by pull_request" is unnecessarily verbose. The phrase "in the job triggered by pull_request" doesn't add meaningful information. Consider simplifying to "✅ All required checks passed" to match the clarity of the description on line 120.
| -f state=success -f context="required-check" -f description="✅ All required checks passed in the job triggered by pull_request" \ | |
| -f state=success -f context="required-check" -f description="✅ All required checks passed" \ |
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.
The condition syntax
if: ${{ github.event_name == 'pull_request' }}is inconsistent with the rest of the file, which uses the simplerif:syntax without wrapping the expression in${{ }}(see lines 44, 59, 86, 113). For consistency, this should be written asif: github.event_name == 'pull_request'.