-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add CI test that fails if a PR is issued to main #1356
Add CI test that fails if a PR is issued to main #1356
Conversation
This is a little tricky. There are several ways to inspect the target branch of the PR. For example, the code below is sufficient. The problem is that if this fails (as intended) when the PR targets main, and the target branch is switched to development, re-running the action will not fix the check. The re-run will not update for the target branch changing, since an action re-run appears to be precisely a re-run of the original action, which at the time it was created was on main, so the re-run also thinks we're still on main. This would resolve itself if a new commit were added though. But we should not want to have to require a new commit just to fix this.
|
This appears to be a symptom of the fact that changing the base branch is actually not an event that triggers a workflow to run within the GitHub pull_request event API. So either we need to manually trigger some action that updates the PR, such as adding a new commit or closing and reopening the PR, or we need some more clever approach that indirectly solves this problem. |
The `edited` activity type includes changes to the base branch, so we need to add that to the trigger types. It also needs to run on development as well as main, so the workflow can succeed once the base branch is changed.
I'm pretty sure this is working now. It turns out target branch changes fall under the |
No description provided.