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

changelog notes protected branch #129

Open
mkatsanto opened this issue Mar 30, 2023 · 1 comment
Open

changelog notes protected branch #129

mkatsanto opened this issue Mar 30, 2023 · 1 comment
Labels
bug Something isn't working future will not be fixed for NOW

Comments

@mkatsanto
Copy link
Collaborator

Describe the bug
The CHANGELOG.md is not working properly in this workflow. The issue is that this action is adding the history of commits to the CHANGELOG.md and then pushes the commit to the protected-dev branch, which is not allowed. The only workarounds for this is to allow this action to act as an administrator or create some ssh key that allows it to force push to the protected dev branch. The question is, do we want that? The other alternative would be to add the commit to each of the PRs upon the pull request. This would not need to bypass any protections, but I am not sure how feasible it is https://github.com/requarks/changelog-action.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@mkatsanto mkatsanto added bug Something isn't working future will not be fixed for NOW labels Mar 30, 2023
@uniqueg
Copy link
Member

uniqueg commented Mar 30, 2023

Hi @mkatsanto,

Creating a personal access token from an admin account is the less appealing solution for me. The other one is fine though.

I have first created a zavolab bot account and added it as a member to our organization. I have then given the bot account permissions to force push to the dev branch of this repo. From the bot account, I have then created a personal access token for the user with the repo and workflow scopes (as described here). Finally, I have created an organization secret AUTO_COMMIT with the value of that token (so we can use that token in every repository where we need auto commit features).

I think if you follow the instructions in the git-auto-commit-action docs, it will hopefully work. In particular, you need to add/replace:

- uses: actions/checkout@v3
  with:
    token: ${{ secrets.AUTO_COMMIT }}

Note that you should probably increase the actions/checkout version to v3, it's currently at v2.

And:

- uses: stefanzweifel/git-auto-commit-action@v4
  with:
    ...
    push_options: --force

@uniqueg uniqueg added this to ideas in ZARP publication Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working future will not be fixed for NOW
Projects
No open projects
Development

No branches or pull requests

2 participants