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

Permission issue running the "update_post" workflow #549

Open
bstansberry opened this issue Feb 29, 2024 · 1 comment
Open

Permission issue running the "update_post" workflow #549

bstansberry opened this issue Feb 29, 2024 · 1 comment
Assignees

Comments

@bstansberry
Copy link
Contributor

bstansberry commented Feb 29, 2024

https://github.com/wildfly/wildfly.org/actions/runs/8099233918/job/22134504371

fails with

 ! [remote rejected] fix_pr_547 -> fix_pr_547 (refusing to allow a GitHub App to create or update workflow `.github/workflows/update_post.yml` without `workflows` permission)
error: failed to push some refs to 'https://github.com/wildfly/wildfly.org'
Error: Process completed with exit code 1.

Reading stuff like https://github.com/orgs/community/discussions/35410 doesn't seem right; we didn't have this problem last time I ran this workflow and nothing has changed that would imply some additional permissions settings need to be applied.

My working theory is this happens because

  1. I merged [#536] update_post action - use the commit message to create PR title #539 yesterday, which changed a workflow file in main
  2. I'm trying to use the update_post action on a PR branch that does not include that change to main.
  3. When update_action tries to push the updated variant of the PR branch to this repo, github detects that this new branch is different from main in that workflow file, and rejects that as an 'update'

If I'm right, the solution is to merge main into the PR branch before adding the commit altering the post date. Or perhaps don't checkout the head of the PR branch if PR_NUM is set and instead checkout refs/pull/PR_NUM/merge. I suspect the former is a simpler change to the current action though, and gives us control over the commit message for the merge commit merging main into the PR branch.

@bstansberry bstansberry self-assigned this Feb 29, 2024
@bstansberry
Copy link
Contributor Author

bstansberry commented Feb 29, 2024

My attempts at this all failed spectacularly, so ???.

I was able to update the 547 PR post date by locally merging that PR branch into main, creating a PR from that "merged branch", and then updating that "merged branch" PR. So that tells me my basic theory of the issue is correct; it's just my solution attempts would fail. (If you're interested in the gory details see today's commit history on main.)

I expect I'll just work around this for now with the expectation that we won't be updating this action very often.

@bstansberry bstansberry mentioned this issue Mar 1, 2024
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

No branches or pull requests

1 participant