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

🔐 security: support npm package provenance #2259

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@ on:
jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup
uses: actions/setup-node@v3
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
node-version: 18.x
cache: yarn

- name: yarn
run: yarn
- run: npm install -g npm

- run: yarn

- name: set npmAuthToken
run: |
yarn config set npmAuthToken ${{ secrets.NODE_AUTH_TOKEN }}
- run: yarn config set npmAuthToken ${{ secrets.NODE_AUTH_TOKEN }}

- name: Release nightly
run: yarn @bud release --tag nightly --registry https://registry.npmjs.org
- run: yarn @bud release --tag nightly --registry https://registry.npmjs.org
8 changes: 6 additions & 2 deletions sources/@repo/yarn-plugin-bud/sources/command/lint.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export class Lint extends Command {
/**
* Command paths
*/
public static paths: CommandClass['paths'] = [[`@bud`, `lint`], [`@bud`, `eslint`], [`lint`]]
public static paths: CommandClass['paths'] = [
[`@bud`, `lint`],
[`@bud`, `eslint`],
[`lint`],
]

/**
* Command usage
Expand All @@ -40,7 +44,7 @@ export class Lint extends Command {
`--config`,
`./config/eslint.config.cjs`,
`--no-error-on-unmatched-pattern`,
...this.passthrough ?? [],
...(this.passthrough ?? []),
],
{stderr: this.context.stderr},
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,15 @@ export class Release extends Command {
this.version = utcSemver
}
}

await this.$([`yarn`, [`@bud`, `version`, this.version]])

await this.$(
`yarn workspaces foreach --no-private npm publish --access public --tag ${this.tag}`,
`yarn workspaces foreach --no-private npm publish --access public --tag ${
this.tag
} ${
this.registry !== `http://localhost:4873` ? `--provenance` : ``
}`,
)

await this.$([`yarn`, [`@bud`, `version`, `0.0.0`]])
Expand Down