Skip to content

Conversation

matejchalk
Copy link
Collaborator

@matejchalk matejchalk commented Sep 25, 2025

The story continues 😅

Related issues and PRs

Problem 1 - authorizing git push

After my last PR, the release workflow failed with:

NX   Unexpected git push error: fatal: could not read Username for 'https://github.com/': No such device or address

This one seems fairly straightforward. I copied persist-credentials: false from an example in actions/create-github-app-token docs. But we need to persist credentials to authorize git 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-in GITHUB_TOKEN). Which poses a dilemma, because we can't bypass the main 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:

  1. release.yml
    • triggered by push to main (merging a PR)
    • runs nx release --skip-publish
    • authenticated as GitHub App
    • ➡️ no OIDC needed because we're not publishing yet
    • ➡️ GitHub App should bypass branch protection on git push
  2. publish.yml
    • triggered by pushing a version tag
    • runs nx release publish
    • authenticated as default GitHub Actions bot with id-token: write permissions
    • ➡️ GitHub App not needed because there's no git push
    • ➡️ OIDC should work for npm publish

I've also changed our access settings on npmjs.com for all (13 😅) packages:

  • replaced release.yml with publish.yml
  • restricted to our release environment (main branch only)
  • enforced MFA and disallowed tokens completely (most secure option)
image

@matejchalk matejchalk self-assigned this Sep 25, 2025
@github-actions github-actions bot added 🦾 CI/CD Continuous integration and deployment 🛠️ tooling labels Sep 25, 2025
Copy link

nx-cloud bot commented Sep 25, 2025

View your CI Pipeline Execution ↗ for commit 3aa6a2b

Command Status Duration Result
nx affected -t e2e-test --parallel=1 ❌ Failed 11m 49s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-25 15:24:52 UTC

Copy link

nx-cloud bot commented Sep 25, 2025

View your CI Pipeline Execution ↗ for commit 3aa6a2b


☁️ Nx Cloud last updated this comment at 2025-09-25 14:50:55 UTC

Copy link

pkg-pr-new bot commented Sep 25, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1121

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1121

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1121

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1121

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1121

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1121

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1121

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1121

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1121

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1121

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1121

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1121

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1121

@code-pushup/models-transformers

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models-transformers@1121

commit: 3aa6a2b

Copy link
Contributor

Code PushUp

😟 Code PushUp report has regressed – compared current commit aa7ff0d with previous commit 38b04e4.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🔴 42 🔴 41 ↓ −1.1
Updates 🟡 85 🟡 84 ↓ −1.1
Code coverage 🟡 90 🟡 90
Security 🟡 56 🟡 56
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Type Safety 🟢 100 🟢 100
Bug prevention 🟢 100 🟢 100
Miscellaneous 🟢 100 🟢 100
Code style 🟢 100 🟢 100
Documentation 🔴 24 🔴 24
👎 2 groups regressed, 👎 4 audits regressed, 17 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🔴 42 🔴 41 ↓ −1.1
JS Packages NPM outdated dependencies 🟡 85 🟡 84 ↓ −1.1

19 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
JS Packages Outdated NPM dev dependencies. 🟨 58 outdated package versions (22 major, 28 minor, 8 patch) 🟨 58 outdated package versions (27 major, 23 minor, 8 patch)  +0 %
Lighthouse Total Blocking Time 🟥 1,080 ms 🟥 1,180 ms ↑ +8.4 %
Lighthouse Speed Index 🟥 5.9 s 🟥 5.9 s ↑ +1.3 %
Lighthouse Max Potential First Input Delay 🟥 820 ms 🟥 840 ms ↑ +2.3 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,032 KiB 🟩 Total size was 2,078 KiB ↑ +2.3 %
Lighthouse Uses efficient cache policy on static assets 🟨 30 resources found 🟨 30 resources found ↓ −0.1 %
Lighthouse JavaScript execution time 🟥 3.4 s 🟥 3.7 s ↑ +9.4 %
Lighthouse Server Backend Latencies 🟩 1,740 ms 🟩 1,470 ms ↓ −15.8 %
Lighthouse Largest Contentful Paint 🟥 10.9 s 🟥 11.1 s ↑ +1.9 %
Lighthouse Minimizes main-thread work 🟥 9.3 s 🟥 9.1 s ↓ −2.2 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 81 KiB 🟥 Potential savings of 102 KiB ↑ +66.7 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 100 KiB 🟥 Potential savings of 100 KiB ↑ +66.7 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +1.5 %
Lighthouse Time to Interactive 🟥 12.4 s 🟥 12.6 s ↑ +1.5 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 178 KiB 🟥 Potential savings of 179 KiB ↓ −8.8 %
Lighthouse Initial server response time was short 🟩 Root document took 520 ms 🟩 Root document took 590 ms ↑ +12.1 %
Lighthouse Network Round Trip Times 🟩 20 ms 🟩 50 ms ↑ +160.7 %
Lighthouse First Contentful Paint 🟥 3.0 s 🟥 3.0 s ↑ +0.5 %
Lighthouse Avoids an excessive DOM size 🟥 2,265 elements 🟥 2,263 elements ↓ −0.1 %
Code coverage Branch coverage 🟨 85.5 % 🟨 85.5 % ↓ −0.1 %
Lighthouse Cumulative Layout Shift 🟩 0 🟩 0.002 ↑ +∞ %

589 other audits are unchanged.

@matejchalk matejchalk marked this pull request as ready for review September 25, 2025 15:13
@matejchalk matejchalk merged commit 4f6fd72 into main Sep 26, 2025
34 of 36 checks passed
@matejchalk matejchalk deleted the split-release-and-publish branch September 26, 2025 07:27
@matejchalk matejchalk mentioned this pull request Sep 26, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦾 CI/CD Continuous integration and deployment 🛠️ tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants