-
Notifications
You must be signed in to change notification settings - Fork 16
ci: fix release workflow - git push, split oidc from custom github app #1121
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
Conversation
View your CI Pipeline Execution ↗ for commit 3aa6a2b
☁️ Nx Cloud last updated this comment at |
View your CI Pipeline Execution ↗ for commit 3aa6a2b ☁️ Nx Cloud last updated this comment at |
@code-pushup/ci
@code-pushup/cli
@code-pushup/core
@code-pushup/create-cli
@code-pushup/models
@code-pushup/nx-plugin
@code-pushup/coverage-plugin
@code-pushup/eslint-plugin
@code-pushup/js-packages-plugin
@code-pushup/jsdocs-plugin
@code-pushup/lighthouse-plugin
@code-pushup/typescript-plugin
@code-pushup/utils
@code-pushup/models-transformers
commit: |
Code PushUp😟 Code PushUp report has regressed – compared current commit aa7ff0d with previous commit 38b04e4. 🕵️ See full comparison in Code PushUp portal 🔍 🏷️ Categories👎 2 groups regressed, 👎 4 audits regressed, 17 audits changed without impacting score🗃️ Groups
19 other groups are unchanged. 🛡️ Audits
589 other audits are unchanged. |
The story continues 😅
Related issues and PRs
Problem 1 - authorizing
git push
After my last PR, the release workflow failed with:
This one seems fairly straightforward. I copied
persist-credentials: false
from an example inactions/create-github-app-token
docs. But we need to persist credentials to authorizegit push
.Problem 2 - OIDC not compatible with GitHub App
The npm docs on trusted publishers mention
id-token: write
must be configured, but that permission isn't available for GitHub Apps. After doing some more research, I've concluded that OIDC is only supported when using the default GitHub Actions bot (built-inGITHUB_TOKEN
). Which poses a dilemma, because we can't bypass themain
branch's Require a pull request before merging rule without the GitHub App.In the end, I think I've solved this problem by splitting it into 2 workflows:
release.yml
main
(merging a PR)nx release --skip-publish
git push
publish.yml
nx release publish
id-token: write
permissionsgit push
npm publish
I've also changed our access settings on npmjs.com for all (13 😅) packages:
release.yml
withpublish.yml
release
environment (main
branch only)