Skip to content

Commit 5a1b425

Browse files
committed
fix: publish workflow and provenance errors
- Add repository field to test-data package.json (fixes npm OIDC provenance verification failure) - Skip publish workflow on forks (only run on less/less.js) - Remove duplicate require('fs') in bump-and-publish.js - Add language specifier to markdown code block in CONTRIBUTING.md
1 parent a08bd0d commit 5a1b425

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
publish:
1818
name: Publish to NPM
1919
runs-on: ubuntu-latest
20-
# Only run on push events, not pull requests
21-
if: github.event_name == 'push'
20+
# Only run on the upstream repo, not forks
21+
if: github.repository == 'less/less.js'
2222

2323
steps:
2424
- name: Checkout code

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The publish script (`scripts/bump-and-publish.js`) auto-increments the patch ver
108108

109109
**Option 1: Commit message** — include `version: X.Y.Z` in the commit body:
110110

111-
```
111+
```text
112112
feat: new feature
113113
114114
version: 4.6.0

packages/test-data/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@
1010
"The Core Less Team"
1111
],
1212
"license": "Apache-2.0",
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/less/less.js.git",
16+
"directory": "packages/test-data"
17+
},
1318
"gitHead": "1df9072ee9ebdadc791bf35dfb1dbc3ef9f1948f"
1419
}

scripts/bump-and-publish.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ function main() {
485485

486486
// Output version for GitHub Actions
487487
if (process.env.GITHUB_OUTPUT) {
488-
const fs = require('fs');
489488
fs.appendFileSync(process.env.GITHUB_OUTPUT, `version=${nextVersion}\n`);
490489
fs.appendFileSync(process.env.GITHUB_OUTPUT, `tag=${tagName}\n`);
491490
}

0 commit comments

Comments
 (0)