Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Commit 0772268

Browse files
authored
trusted publisher (#264)
* minimumReleaseAgeの追加 * trusted publisherに対応 * update permission
1 parent b8c6221 commit 0772268

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/renovate.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
],
1010
timezone: 'Asia/Tokyo',
1111
postUpdateOptions: ['yarnDedupeHighest'],
12+
minimumReleaseAge: '7 days',
1213
}

.github/workflows/publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ concurrency:
1717
group: ${{ github.workflow }}
1818
cancel-in-progress: true
1919

20+
permissions:
21+
id-token: write # Required for OIDC
22+
contents: write # create tag and release
23+
2024
jobs:
2125
publish:
2226
runs-on: ubuntu-latest
@@ -28,6 +32,11 @@ jobs:
2832
node-version-file: '.node-version'
2933
cache: 'yarn'
3034
registry-url: 'https://registry.npmjs.org'
35+
36+
# Trusted publishing requires npm CLI version 11.5.1 or later.
37+
- name: Ensure npm >= 11.5.1
38+
run: npm i -g npm@^11.5.1
39+
3140
- name: Install dependencies
3241
run: yarn install --frozen-lockfile
3342

@@ -37,9 +46,8 @@ jobs:
3746
git config user.name '[bot] github action (${{ github.workflow }})'
3847
git config user.email '[email protected]'
3948
yarn version --${{ github.event_name == 'schedule' && 'patch' || github.event.inputs.versionClass }}
49+
yarn run publish
4050
echo "new_version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
41-
env:
42-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4351
4452
- name: Create release
4553
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"check:prettier": "prettier --check .",
2222
"format": "prettier --write .",
2323
"preversion": "echo \"Run check for version $npm_package_version\" && yarn run check",
24-
"postversion": "git push --tags && git push origin main && yarn publish ."
24+
"publish": "npm publish . && git push origin main && git push --tags"
2525
},
2626
"dependencies": {
2727
"stylelint": "16.24.0",

0 commit comments

Comments
 (0)