-
Notifications
You must be signed in to change notification settings - Fork 373
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
Update workflows to support fork PRs #3544
Conversation
This introduces another bundle of joy for anyone working on our CI:
|
can't test this on the PR that introduces it...
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 overall concept seems sound. A few questions regarding possible refactors, but we can also punt those until we have more time if they are too much work.
checks: | ||
name: Checks | ||
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' |
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.
These have to be on a per-job basis rather than just skipping the whole workflow?
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.
I think so, or at least I couldn't find a better way to do this. We need to know if the PR comes from within the rerun-io
organization, and there doesn't seem to be a built-in way to do this on pull_request
events.
checks: | ||
name: "Checks" | ||
if: github.event.pull_request.head.repo.owner.login != 'rerun-io' | ||
uses: ./.github/workflows/contrib/checks.yml | ||
with: | ||
CONCURRENCY: pr-${{ github.event.pull_request.number }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} |
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.
Doesn't really matter, but I feel like it would be more obvious to have these in on_pull_request
following the non-contrib sections.
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.
I wanted the name of the workflow to be different from the usual Pull-Request
, because GH generates the full name of the job by concatenating the name with the parent workflow
.github/workflows/contrib/checks.yml
Outdated
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.
I'm a bit worried about maintainabillity here.
How much worse would it be to add a workflow_call
parameter such as:
CONTRIB:
type: boolean
required: false
default: true
And then parameterizing the job instead of forking.
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.
I tried it, and found it to be significantly worse. These if
checks get lost in the mass of yaml. I think the duplication makes this slightly more maintainable.
Merging so I can test an external contribution |
What
Part of #1994
This duplicates certain workflows and sanitizes them to not use secrets. Anything that uses secrets must run on
pull_request_target
.A similar attempt was made in #1991
Checklist