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

Give release action permissions to push to main #251

Merged
merged 8 commits into from
Sep 26, 2024

Conversation

StepanBrychta
Copy link
Contributor

@StepanBrychta StepanBrychta commented Sep 23, 2024

What does this change?

Gives the release GitHub action the necessary permissions to push changes directly into main.

This is done by configuring the release action to assume the role of the Wellcome Collection GitHub app when pushing changes to main. The implementation involves creating a token from the app's private key and follows official GitHub documentation.

Separately, the Wellcome Collection GitHub app was given the necessary permissions to bypass the requires-review rule.

How to test

I tested this change by temporarily removing the part of the workflow which publishes to Sonatype and running the GitHub action from this branch, which resulted in a successful push to main (see here), which I subsequently reverted.

How can we measure success?

The release action runs successfully.

Have we considered potential risks?

Giving the GitHub action full repo access comes with security risks. However, the original Buildkite pipeline was using a similar setup, so this should not introduce any new risks.

I have considered alternative release setups which do not involve pushing directly into main, but these setups have significant limitations (see here) and are not viable alternatives.

Copy link

github-actions bot commented Sep 23, 2024

Suspected binary incompatible evictions across all projects (summary)

  • org.scala-lang:scala-library:2.12.17 is selected over {2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.8, 2.12.15, 2.12.16}
  • org.scala-lang:scala-library:2.12.18 is selected over {2.12.15, 2.12.15, 2.12.17, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.8, 2.12.15, 2.12.15, 2.12.17, 2.12.17, 2.12.16, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.8, 2.12.15, 2.12.17, 2.12.17, 2.12.17, 2.12.16, 2.12.15, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.8, 2.12.15, 2.12.17, 2.12.17, 2.12.17, 2.12.16, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.18, 2.12.18, 2.12.18, 2.12.8, 2.12.17, 2.12.15, 2.12.15, 2.12.18, 2.12.18, 2.12.18, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.18, 2.12.18, 2.12.18, 2.12.8, 2.12.17, 2.12.15, 2.12.15, 2.12.18, 2.12.18, 2.12.18, 2.12.15, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.17, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.12, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.8, 2.12.15, 2.12.15, 2.12.17, 2.12.17, 2.12.16, 2.12.15, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.18, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.18, 2.12.18, 2.12.18, 2.12.18, 2.12.8, 2.12.17, 2.12.15, 2.12.15, 2.12.17, 2.12.17, 2.12.16, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.18, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.15, 2.12.18, 2.12.18, 2.12.18, 2.12.18, 2.12.8, 2.12.17, 2.12.15, 2.12.15, 2.12.17, 2.12.17, 2.12.16, 2.12.15, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.8, 2.12.15, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.8, 2.12.15, 2.12.15, 2.12.15}
  • org.scala-lang:scala-library:2.12.19 is selected over {2.12.15, 2.12.15, 2.12.8, 2.12.15, 2.12.15}
  • org.slf4j:slf4j-api:2.0.4 is selected over {1.7.36, 1.7.36, 1.7.9, 1.7.30, 1.7.30, 1.7.30, 1.7.30}
  • org.slf4j:slf4j-api:2.0.4 is selected over {1.7.36, 1.7.36, 1.7.9, 1.7.30, 1.7.30, 1.7.30}
  • org.slf4j:slf4j-api:2.0.7 is selected over {1.7.9, 1.7.30, 1.7.30, 1.7.30}
  • org.slf4j:slf4j-api:2.0.7 is selected over {2.0.4, 1.7.36, 1.7.36, 1.7.9, 1.7.30, 1.7.30, 1.7.30}

See individual evictions stages for more detail

@StepanBrychta StepanBrychta force-pushed the Give-release-action-permissions-to-push-to-main branch 2 times, most recently from eef42f3 to 8882728 Compare September 23, 2024 09:53
@StepanBrychta StepanBrychta force-pushed the Give-release-action-permissions-to-push-to-main branch from 8882728 to a1df1f9 Compare September 23, 2024 09:58
@StepanBrychta StepanBrychta marked this pull request as ready for review September 23, 2024 10:11
@StepanBrychta StepanBrychta force-pushed the Give-release-action-permissions-to-push-to-main branch 2 times, most recently from 50370de to 137fd2f Compare September 23, 2024 13:03
@StepanBrychta StepanBrychta force-pushed the Give-release-action-permissions-to-push-to-main branch from 137fd2f to a67ae68 Compare September 23, 2024 13:32
@agnesgaroux
Copy link
Contributor

agnesgaroux commented Sep 24, 2024

Very nice! 🙌
In today's episode of "Making it more complicated than it ought to be" I got it into my head that the private key had to be stored somewhere other than GHA secrets. This is real neat in tandem with actions/create-github-app-token@v1

@agnesgaroux
Copy link
Contributor

agnesgaroux commented Sep 24, 2024

Would it be safe to store this private key as an organisation GHA secret? that way we can let more repos use it as needed, but maybe it's safer to have different keys for different repos or even different workflows

@StepanBrychta
Copy link
Contributor Author

@agnesgaroux Good idea, the key is now an organisation secret

@StepanBrychta StepanBrychta merged commit 41620d9 into main Sep 26, 2024
28 checks passed
@StepanBrychta StepanBrychta deleted the Give-release-action-permissions-to-push-to-main branch September 26, 2024 13:39
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

Successfully merging this pull request may close these issues.

2 participants