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

Fix git push in publish workflow #1865

Open
bquorning opened this issue Apr 5, 2024 · 2 comments
Open

Fix git push in publish workflow #1865

bquorning opened this issue Apr 5, 2024 · 2 comments

Comments

@bquorning
Copy link
Collaborator

The final git push is failing because of our branch protection rules: https://github.com/rubocop/rubocop-rspec/actions/runs/8561970997/job/23464311900

@ydah suggested maybe the solution is as follows:

  • creating a service account user that has read-write access to repo
  • create a pat for that service account
  • add the service account to the bypass protection rules in the branch
  • create a repo secret that contains the PAT token
  • push using the created service account
@bquorning
Copy link
Collaborator Author

Fixed by #1869.

@bquorning
Copy link
Collaborator Author

In #2007 I added permissions for actions to the workflow, but they still don’t run on the created pull requests. A colleague pointed me to https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs, and the easiest workaround listed there is to just have a human close and reopen the PR.

Or have the script open a draft PR, and then the actions will run when a human marks it as Ready for review. But we wouldn’t get notifications for a draft PR.

The more correct solution would be to create a machine account with collaborator access on the RuboCop organization (or this repo specifically) and create a PAT that we can use when opening the PR.

@bquorning bquorning reopened this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants