Skip to content
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

Keep docsgen from updating protected branches #43

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Conversation

webbnh
Copy link
Contributor

@webbnh webbnh commented Aug 29, 2024

Changes introduced with this PR

This PR adds a check to the docsgen reusable workflow which skips the step where it updates the branch if the branch is protected (like main), because attempting the update will result in an error which will cause the workflow (and the rest of the CI) to fail.

We're not supposed to need updates to protected branches, as the updates are supposed to have been applied to PRs before they are merged, so, under normal circumstances, this change should have no impact. (And, if an update is actually required, it should be detected and applied to the next PR to come along, anyway.)

However, under unusual circumstances (such as when a PR is merged too quickly for the bot to respond, or when the bot is producing an unstable result (arcalot/arcaflow-plugin-fio#39)) this change will prevent the main branch CI from failing.


By contributing to this repository, I agree to the contribution guidelines.

@webbnh
Copy link
Contributor Author

webbnh commented Aug 29, 2024

Testing complete:

@webbnh webbnh marked this pull request as ready for review August 29, 2024 21:01
Copy link

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, OK; I suppose all the repos must at least have main protected.

@webbnh webbnh merged commit 20bfdd8 into main Aug 30, 2024
3 checks passed
@webbnh webbnh deleted the no-doc-update-on-main branch August 30, 2024 15:51
@webbnh
Copy link
Contributor Author

webbnh commented Aug 30, 2024

Yeah, OK; I suppose all the repos must at least have main protected.

Yeah, I contemplated filtering based on whether the target was a branch (as opposed to a PR), but our practice has drifted toward using upstream branches for PRs; I considered excluding particular names (e.g., main), but that seemed cumbersome and unreliable; and, I considered ruling out tags (either by name or as a class). I finally concluded that, since the harm only arises when the bot is unable to push the commit, and that happens only when the branch is protected, I sould use that as the basis of the filter, since GitHub conveniently offers a test for it.

And, yeah, the main branch should be protected. (And, if it's not, then I guess the bot is free to update it....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants