Skip to content

Commit 8d9b592

Browse files
committed
refactor: fix semantic-release publishing
1 parent 9090fd5 commit 8d9b592

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

renovate.json renamed to .github/renovate.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
44
"github>sanity-io/renovate-config",
5-
"github>sanity-io/renovate-config:studio-v3",
6-
":reviewer(team:ecosystem)"
5+
"github>sanity-io/renovate-config:studio-v3"
76
],
87
"packageRules": [
98
{

.github/workflows/main.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,29 @@ jobs:
9595

9696
release:
9797
permissions:
98-
contents: write # to be able to publish a GitHub release
99-
issues: write # to be able to comment on released issues
100-
pull-requests: write # to be able to comment on released pull requests
98+
contents: read
10199
id-token: write # to enable use of OIDC for npm provenance
102100
needs: [build, test]
103101
# only run if opt-in during workflow_dispatch
104102
if: always() && github.event.inputs.release == 'true' && needs.build.result != 'failure' && needs.test.result != 'failure' && needs.test.result != 'cancelled'
105103
runs-on: ubuntu-latest
106104
name: Semantic release
107105
steps:
108-
- uses: actions/checkout@v4
106+
- uses: actions/create-github-app-token@v2
107+
id: app-token
108+
with:
109+
app-id: ${{ secrets.ECOSPARK_APP_ID }}
110+
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
111+
- uses: actions/checkout@v5
109112
with:
110113
# Need to fetch entire commit history to
111114
# analyze every commit since last release
112115
fetch-depth: 0
113-
- uses: actions/setup-node@v4
116+
# Uses generated token to allow pushing commits back
117+
token: ${{ steps.app-token.outputs.token }}
118+
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
119+
persist-credentials: false
120+
- uses: actions/setup-node@v6
114121
with:
115122
cache: npm
116123
node-version: lts/*
@@ -121,11 +128,6 @@ jobs:
121128
# e.g. git tags were pushed but it exited before `npm publish`
122129
if: always()
123130
env:
124-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125-
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
126-
# Re-run semantic release with rich logs if it failed to publish for easier debugging
127-
- run: npx semantic-release --dry-run --debug
128-
if: failure()
129-
env:
130-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131+
NPM_CONFIG_PROVENANCE: true
132+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
131133
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@
111111
"node": ">=18"
112112
},
113113
"publishConfig": {
114-
"access": "public",
115-
"provenance": true
114+
"access": "public"
116115
},
117116
"sanityExchangeUrl": "https://www.sanity.io/plugins/sanity-plugin-mux-input",
118117
"browserslist": "extends @sanity/browserslist-config",

0 commit comments

Comments
 (0)