-
Notifications
You must be signed in to change notification settings - Fork 2
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 workflow for PRs #45
Conversation
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.
Hmm. That's ... interesting.
I tested this using arcalot/arcaflow-plugin-rtla#2 and, once I got the wrinkles smoothed out, the docsgen run was able to update my branch and the workflow was able to reset the checkout to the original (which does not contain the update...but it was safe on my branch). So, @dustinblack, you should be able to pop 5007ae2 and eb58c53 from your branch, and when you push the result up the bot should push the updates back on. (Assuming that your PR uses this PR's updated workflow.) |
I'll give @dustinblack a chance to look and comment before this is merged. (Dustin, feel free to do the merge if you are good with this change.) |
The current workflow is broken when triggered by a PR event (see arcalot/arcaflow-plugin-rtla#1): the GHA checkout uses a detached head from a temporary branch, and so the attempt to push the update fails. (When triggered by a branch update event, it runs on a "real branch", and there's no problem.)
This PR tweaks the update step of the workflow:
README.md
file and commits it to the branchThese steps are taken only if the trigger was a pull request (and only if there is a difference in the generated documentation). The value of
github.head_ref
is only available for PRs, so none of this will work for other triggers. And, more importantly, I suspect that we don't want this step to run except for PRs -- that is, I don't think we want to bot making changes to branches when no one is supervising. (The current state disables this step if the branch is protected, but that doesn't seem strict enough to me.)This PR also streamlines the difference check in a separate commit.
Note: until this PR is merged, you can try it out by modifying your plugin workflow to reference
@PR-support
instead of@main
.By contributing to this repository, I agree to the contribution guidelines.