Skip to content

Tighten CI workflows - #317

Merged
XhmikosR merged 3 commits into
mainfrom
xmr/actions
Apr 23, 2026
Merged

XhmikosR merged 3 commits into
mainfrom
xmr/actions

Conversation

@XhmikosR

@XhmikosR XhmikosR commented Apr 23, 2026 •

Copy link
Copy Markdown
Member

@joscha: this should improve things, but still won't work without a new limited/restricted npm token only for this package.

Only using OIDC will probably work in the future without someone having to renew the token every 90 days.

Let me know how you want to proceed. I assume you've seen all the supply chain attacks on npm, hence why I'm trying to tighten things.

@XhmikosR XhmikosR changed the title Actions: add permissions Tighten CI workflows Apr 23, 2026
@XhmikosR
XhmikosR force-pushed the xmr/actions branch 2 times, most recently from 0da49f2 to db4006a Compare April 23, 2026 05:58
@XhmikosR

Copy link
Copy Markdown
Member Author

@joscha: will you add the new short-lived restricted-to-this-package only token to the repo?

@joscha

joscha commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

@joscha: will you add the new short-lived restricted-to-this-package only token to the repo?

I can do, but shouldn't we try to enable oidc?

@XhmikosR

XhmikosR commented Apr 23, 2026 •

Copy link
Copy Markdown
Member Author

OK, in that case I will need to drop NODE_AUTH_TOKEN. Let me know after you enable it.

BTW even with the token, provenance should be published, but it's more of a good to have not a security measure.

@XhmikosR
XhmikosR marked this pull request as ready for review April 23, 2026 13:03
jobs:
publish:
# only allow on main or tags
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep this one, no?

@XhmikosR XhmikosR Apr 23, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the only allowed type is published we are guaranteed to only have tags IIRC.

@joscha

joscha commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

OK, in that case I will need to drop NODE_AUTH_TOKEN. Let me know after you enable it.

Done:
SCR-20260423-sfpj

With the current configuration, publishing has to happen from .github/workflows/npm-publish.yml and in an environment called publish.
I restricted publishing to tags matching v[0-9]*.[0-9]*.[0-9]* and either you or me as a reviewer.

Let me know what you think!

@XhmikosR

Copy link
Copy Markdown
Member Author

Sounds, good, I'm going to merge and then make a new release to test :)

@XhmikosR
XhmikosR merged commit 536b30f into main Apr 23, 2026
6 checks passed
@XhmikosR
XhmikosR deleted the xmr/actions branch April 23, 2026 13:52
@XhmikosR

Copy link
Copy Markdown
Member Author

@joscha so apparently we still need NODE_AUTH_TOKEN. But it needs to be an npm Automation token with publish access to the detective-postcss package.

I created 8.0.3 but have not made a release yet.

@joscha

joscha commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

@joscha so apparently we still need NODE_AUTH_TOKEN. But it needs to be an npm Automation token with publish access to the detective-postcss package.

can you point me to the docs? I didn't understand we still need that. Did you change the yml to add the publish environment in?

@XhmikosR

Copy link
Copy Markdown
Member Author

Oh, I didn't add the publish environment. I added it now. It seems to work :)

First time I actually use the environment config.

@joscha

joscha commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Oh, I didn't add the publish environment. I added it now. It seems to work :)

Great!

@XhmikosR

Copy link
Copy Markdown
Member Author

@joscha BTW I disabled token publishing on npm now that OIDC is set up.

@joscha

joscha commented Apr 25, 2026

Copy link
Copy Markdown
Collaborator

@joscha BTW I disabled token publishing on npm now that OIDC is set up.

Ah perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants