-
Notifications
You must be signed in to change notification settings - Fork 117
refactor(ci): auto-run workflow for fork PRs #4287
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
base: main
Are you sure you want to change the base?
Changes from all commits
e0a359f
85a18f3
e0c54ec
850314d
e4a844f
94e18c4
0eaffd0
ce82ac9
856b5cb
54897e2
b1a0cf0
0111148
f5b6dc4
b5e9024
a84a97a
883ead3
4e54a7d
8c90ed9
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,14 +26,76 @@ on: | |||||||||
| - 'ci-enable/**' | ||||||||||
| - 'main' | ||||||||||
| pull_request: | ||||||||||
| types: [opened, synchronize, reopened] | ||||||||||
| issue_comment: | ||||||||||
| types: [created] | ||||||||||
| workflow_dispatch: | ||||||||||
|
|
||||||||||
| concurrency: | ||||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||||||||||
|
Comment on lines
34
to
36
|
||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| check-permissions: | ||||||||||
| if: | | ||||||||||
| github.event_name == 'push' || | ||||||||||
| github.event_name == 'workflow_dispatch' || | ||||||||||
| github.event_name == 'pull_request' || | ||||||||||
| ( | ||||||||||
| github.event_name == 'issue_comment' && | ||||||||||
| github.event.issue.pull_request != null && | ||||||||||
| contains(github.event.comment.body, '/safe-to-test') | ||||||||||
| ) | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| outputs: | ||||||||||
| sha: ${{ steps.resolve.outputs.sha }} | ||||||||||
| steps: | ||||||||||
| - name: Resolve SHA | ||||||||||
| id: resolve | ||||||||||
| env: | ||||||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||
| run: | | ||||||||||
| if [ "${{ github.event_name }}" == "issue_comment" ]; then | ||||||||||
| SHA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} --jq '.head.sha') | ||||||||||
| echo "sha=$SHA" >> $GITHUB_OUTPUT | ||||||||||
|
Comment on lines
+59
to
+60
|
||||||||||
| SHA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} --jq '.head.sha') | |
| echo "sha=$SHA" >> $GITHUB_OUTPUT | |
| REF="refs/pull/${{ github.event.issue.number }}/merge" | |
| echo "sha=$REF" >> $GITHUB_OUTPUT |
Copilot
AI
Mar 12, 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.
This git diff origin/${{ github.base_ref }}...HEAD can fail because origin/${{ github.base_ref }} may not exist in the checkout (even with fetch-depth: 0), and any git diff failure will abort the step (only grep is guarded with || true). Consider diffing by explicit SHAs from the event payload (e.g., PR base/head SHAs) and/or fetching the base ref before diffing, and ensure the git diff invocation itself can't hard-fail the workflow due to a missing ref.
| CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -c "^\.github/workflows/github-action-build\.yml$" || true) | |
| CHANGED=$((git diff --name-only origin/${{ github.base_ref }}...HEAD 2>/dev/null || true) | grep -c "^\.github/workflows/github-action-build\.yml$" || true) |
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.
nit: shall we use needs.has_permission == true?
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ texera: | |
| # Container image registry and tag for all Texera services | ||
| # Override these to use a different registry or version | ||
| imageRegistry: ghcr.io/apache | ||
| imageTag: latest | ||
| imageTag: nightly | ||
|
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. is this change related?
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. No, that is related to a different pr. @aicam can remove it. |
||
|
|
||
| global: | ||
| # Required by Bitnami sub-charts (postgresql, minio) to allow custom images | ||
|
|
||
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 would trigger CI actions every time some one posts a comment right? I think it will be a waste of resources. github action is free with a cap.
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.
Yes, but this is the only plausible workaround I could think of for this comment (#4278 (comment)). The problem is that either:
Committers can't just rerun the failed workflow, as it will trigger a GitHub run with the pull request owners' credentials.
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.
how about this:
Does that satisfy your need?
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.
Sounds good, I will add back the label method and update the corresponding issue with a diagram of the current GitHub action flow.
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.
As mentioned, we might need to modify the auto labeler logic first. do you want to do it as well?