@codfish/actions-playground 0.0.0-PR-77--2cb1b74 → 0.0.0-PR-98--c28fd93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,7 @@ on:
12
12
 
13
13
  permissions:
14
14
  contents: write
15
+ id-token: write
15
16
  pull-requests: write
16
17
  issues: write
17
18
 
@@ -74,6 +75,9 @@ jobs:
74
75
 
75
76
  - run: cat Dockerfile
76
77
 
78
+ - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
79
+ run: npm audit signatures
80
+
77
81
  - name: semantic-release
78
82
  uses: docker://ghcr.io/codfish/semantic-release-action@sha256:327a3ce08284f9dd9b83b607e3f668dae90139e68ce90780b0a43a09d577dc3a
79
83
  id: semantic
@@ -127,7 +131,6 @@ jobs:
127
131
  ]
128
132
  env:
129
133
  GITHUB_TOKEN: ${{ secrets.SEMANTIC_GH_TOKEN }}
130
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
131
134
 
132
135
  - name: Dump semantic outputs
133
136
  if: steps.semantic.outputs.new-release-published == 'true'
@@ -13,6 +13,8 @@ jobs:
13
13
  cancel-in-progress: true
14
14
 
15
15
  steps:
16
+ - uses: actions/checkout@v6
17
+
16
18
  - name: 'Install pnpm'
17
19
  id: pnpm-setup
18
20
  uses: pnpm/action-setup@v4
@@ -2,6 +2,11 @@ name: Validate Code
2
2
 
3
3
  on: pull_request
4
4
 
5
+ permissions:
6
+ contents: read
7
+ id-token: write
8
+ pull-requests: write
9
+
5
10
  jobs:
6
11
  validate:
7
12
  runs-on: ubuntu-latest
@@ -11,7 +16,7 @@ jobs:
11
16
  cancel-in-progress: true
12
17
 
13
18
  steps:
14
- - uses: actions/checkout@v5
19
+ - uses: actions/checkout@v6
15
20
  with:
16
21
  fetch-depth: 0
17
22
 
@@ -36,63 +41,24 @@ jobs:
36
41
  echo "$PNPM_CONTEXT"
37
42
  echo "PNPM_HOME: $PNPM_HOME"
38
43
 
39
- - uses: codfish/actions/setup-node-and-install@fixes
40
-
41
- - name: semantic release dry run
42
- uses: docker://ghcr.io/codfish/semantic-release-action@sha256:327a3ce08284f9dd9b83b607e3f668dae90139e68ce90780b0a43a09d577dc3a
44
+ - uses: actions/setup-node@v4
43
45
  with:
44
- dry-run: true
45
- additional-packages: |
46
- ['@google/semantic-release-replace-plugin', '@semantic-release/git', 'conventional-changelog-conventionalcommits@7']
47
- plugins: |
48
- [
49
- '@semantic-release/commit-analyzer',
50
- [
51
- '@google/semantic-release-replace-plugin',
52
- {
53
- 'replacements': [
54
- {
55
- 'files': ['Dockerfile'],
56
- 'from': 'RELEASE_VERSION=.*',
57
- 'to': 'RELEASE_VERSION=${nextRelease.version}'
58
- },
59
- {
60
- 'files': ['provisioning/Chart.yml'],
61
- 'from': 'ersion: .*',
62
- 'to': 'ersion: ${nextRelease.version}'
63
- }
64
- ]
65
- }
66
- ],
67
- [ '@semantic-release/git', {'assets': ['Dockerfile', 'provisioning/Chart.yml']} ],
68
- [
69
- "@semantic-release/release-notes-generator",
70
- {
71
- "preset": "conventionalcommits",
72
- "presetConfig": {
73
- "types": [
74
- { type: 'feat', section: 'Features', hidden: false },
75
- { type: 'fix', section: 'Bug Fixes', hidden: false },
76
- { type: 'perf', section: 'Performance Improvements', hidden: false },
77
- { type: 'revert', section: 'Reverts', hidden: false },
78
- { type: 'docs', section: 'Other Updates', hidden: false },
79
- { type: 'style', section: 'Other Updates', hidden: false },
80
- { type: 'chore', section: 'Other Updates', hidden: false },
81
- { type: 'refactor', section: 'Other Updates', hidden: false },
82
- { type: 'test', section: 'Other Updates', hidden: false },
83
- { type: 'build', section: 'Other Updates', hidden: false },
84
- { type: 'ci', section: 'Other Updates', hidden: false }
85
- ]
86
- }
87
- }
88
- ],
89
- '@semantic-release/npm',
90
- '@semantic-release/github'
91
- ]
92
- pnpm-dest: ${{ steps.pnpm-setup.outputs.dest }}
93
- env:
94
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46
+ node-version-file: 'package.json'
47
+ cache: 'pnpm'
48
+
49
+ - name: Install dependencies
50
+ run: pnpm install --frozen-lockfile
51
+
52
+ - name: Ensure npm 11.5.1+ for trusted publishing
53
+ run: |
54
+ echo "Current npm version: $(npm --version)"
55
+ # npm 11.5.1+ is required for OIDC trusted publishing (Jan 2026)
56
+ npm install -g npm@latest
57
+ echo "Updated npm version: $(npm --version)"
58
+ if [ "$(npm --version | cut -d. -f1)" -lt 11 ]; then
59
+ echo "ERROR: npm 11.5.1+ is required for trusted publishing"
60
+ exit 1
61
+ fi
96
62
 
97
63
  - name: Retrieve text file
98
64
  uses: actions/download-artifact@v4
@@ -108,10 +74,37 @@ jobs:
108
74
  - name: run tests
109
75
  run: pnpm test
110
76
 
111
- - uses: codfish/actions/npm-publish-pr@fixes
112
- with:
113
- github-token: ${{ secrets.GITHUB_TOKEN }}
114
- npm-token: ${{ secrets.NPM_TOKEN }}
77
+ - name: Publish PR package (direct)
78
+ if: github.event.pull_request.head.repo.full_name == github.repository
79
+ shell: bash
80
+ env:
81
+ PR_NUMBER: ${{ github.event.number }}
82
+ PR_SHA: ${{ github.event.pull_request.head.sha }}
83
+ run: |
84
+ set -euo pipefail
85
+
86
+ # Verify OIDC token is available
87
+ if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then
88
+ echo "OIDC token is not available for this run. Trusted publishing cannot proceed."
89
+ echo "This usually happens on forked PRs or when id-token permissions are missing."
90
+ exit 1
91
+ fi
92
+
93
+ echo "OIDC environment detected:"
94
+ echo "ACTIONS_ID_TOKEN_REQUEST_URL is set: ${ACTIONS_ID_TOKEN_REQUEST_URL:+yes}"
95
+ echo "ACTIONS_ID_TOKEN_REQUEST_TOKEN is set: ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:+yes}"
96
+
97
+ short_sha="$(echo "$PR_SHA" | cut -c -7)"
98
+ version="0.0.0-PR-${PR_NUMBER}--${short_sha}"
99
+ echo "Publishing $(jq -r '.name' package.json)@$version via OIDC trusted publishing"
100
+ npm version "$version" --no-git-tag-version
101
+
102
+ # CRITICAL: Do not set, unset, or manipulate NODE_AUTH_TOKEN or NPM_TOKEN
103
+ # They must not exist in the environment for OIDC to work
104
+ echo "npm version: $(npm --version)"
105
+
106
+ # Publish with OIDC - npm will automatically use OIDC when --provenance is used
107
+ npm publish --access public --tag pr --provenance
115
108
 
116
109
  - name: Build package
117
110
  run: pnpm build
File without changes
package/package.json CHANGED
@@ -1,11 +1,23 @@
1
1
  {
2
2
  "name": "@codfish/actions-playground",
3
- "version": "0.0.0-PR-77--2cb1b74",
3
+ "version": "0.0.0-PR-98--c28fd93",
4
4
  "description": "My own testing ground for messing around with GitHub Actions.",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
+ "scripts": {
10
+ "start": "PUBLIC_URL=/ react-scripts start",
11
+ "build": "react-scripts build",
12
+ "build:docs": "jsdoc src -d docs",
13
+ "eject": "react-scripts eject",
14
+ "format": "cod-scripts format",
15
+ "lint": "cod-scripts lint",
16
+ "lint:md": "markdownlint -i node_modules -i dist .",
17
+ "lint:commit": "cod-scripts commitlint",
18
+ "test": "echo \"No tests yet.\"",
19
+ "validate": "cod-scripts validate"
20
+ },
9
21
  "repository": {
10
22
  "type": "git",
11
23
  "url": "git+https://github.com/codfish/actions-playground.git"
@@ -13,6 +25,7 @@
13
25
  "keywords": [
14
26
  "foobar"
15
27
  ],
28
+ "packageManager": "pnpm@10.17.1",
16
29
  "author": "",
17
30
  "license": "MIT",
18
31
  "bugs": {
@@ -41,6 +54,33 @@
41
54
  "./node_modules/cod-scripts/eslint.js"
42
55
  ]
43
56
  },
57
+ "commitlint": {
58
+ "extends": [
59
+ "@commitlint/config-conventional"
60
+ ],
61
+ "rules": {
62
+ "header-max-length": [
63
+ 0,
64
+ "never"
65
+ ],
66
+ "subject-case": [
67
+ 0,
68
+ "never"
69
+ ],
70
+ "type-case": [
71
+ 0,
72
+ "never"
73
+ ],
74
+ "body-max-line-length": [
75
+ 0,
76
+ "always"
77
+ ],
78
+ "footer-max-line-length": [
79
+ 0,
80
+ "always"
81
+ ]
82
+ }
83
+ },
44
84
  "browserslist": {
45
85
  "production": [
46
86
  ">0.2%",
@@ -56,17 +96,5 @@
56
96
  "volta": {
57
97
  "node": "22.18.0",
58
98
  "yarn": "4.10.3"
59
- },
60
- "scripts": {
61
- "start": "PUBLIC_URL=/ react-scripts start",
62
- "build": "react-scripts build",
63
- "build:docs": "jsdoc src -d docs",
64
- "eject": "react-scripts eject",
65
- "format": "cod-scripts format",
66
- "lint": "cod-scripts lint",
67
- "lint:md": "markdownlint -i node_modules -i dist .",
68
- "lint:commit": "cod-scripts commitlint",
69
- "test": "echo \"No tests yet.\"",
70
- "validate": "cod-scripts validate"
71
99
  }
72
- }
100
+ }
package/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended"
5
+ ]
6
+ }
package/test.txt CHANGED
@@ -3,4 +3,3 @@ testing dry run outputs
3
3
  test release with a chore
4
4
 
5
5
  test latest release
6
-