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

Publish workflow cannot push to protected branch #341

Closed
CasperWA opened this issue Jun 12, 2020 · 7 comments
Closed

Publish workflow cannot push to protected branch #341

CasperWA opened this issue Jun 12, 2020 · 7 comments
Assignees
Labels
bug Something isn't working CI Continuous Integration - GitHub Actions issues (NOT related to the repository Action)

Comments

@CasperWA
Copy link
Member

The publish workflow fails due to an attempt at pushing to a protected branch.

Possible solutions:

  • Allow a specific username to push to the branch, use this username
  • Create a PR instead.

The first option may be dangerous, since it will open up the possibility of a user force pushing to master without our consent.
The second option fails to be a "one-button-option".

@CasperWA CasperWA added bug Something isn't working CI Continuous Integration - GitHub Actions issues (NOT related to the repository Action) labels Jun 12, 2020
@shyamd
Copy link
Contributor

shyamd commented Jun 13, 2020

I suggest we go with the first option and use @gmrigna github user for this so we don't screw things up?

We can also unprotect the master since it does require signed commits, which are hard to do from terminal client.

@CasperWA
Copy link
Member Author

I suggest we go with the first option and use @gmrigna github user for this so we don't screw things up?

How does that work with signing on and security in the context of our Action?

We can also unprotect the master since it does require signed commits, which are hard to do from terminal client.

Not a fan of this. Maybe instead we can create a bot OPTIMADE-dev user?

@shyamd
Copy link
Contributor

shyamd commented Jun 13, 2020

It would just use a personal access token that @gmrigna would have to make and put in secrets. It would have no use outside of actions.

Making a bot user is not much different. It's just another account for someone to maintain and bot accounts are generally neglected.

@CasperWA
Copy link
Member Author

Right, PAT should work - true.
Then we go through the GitHub API and all that jazz?

@shyamd
Copy link
Contributor

shyamd commented Jun 13, 2020

No, we just add @gmrigna as an exception to the normal protection rules. Have him put his PAT in as a secret, and just switch that commit action to use the PAT in the secret.

@CasperWA
Copy link
Member Author

Well if that works and the two-layered security of a valid username+PAT works, then that would be an implementable solution for sure.

@CasperWA
Copy link
Member Author

This has been solved by the newest edition of the publish workflow, utilizing the action CasperWA/push-protected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CI Continuous Integration - GitHub Actions issues (NOT related to the repository Action)
Projects
None yet
Development

No branches or pull requests

2 participants