Skip to content

Commit ceae07b

Browse files
authored
fix: set version script (#2724)
## Description https://github.com/defenseunicorns/pepr/actions/runs/18715887653/job/53376421615#step:7:697 It is trying to do a slsa publish with the 0.0.0-development version, the problem is the job below needs to tag. Hopefully this will create the correct rtag ```yaml slsa: # This is where the slsa tarball is built for publish-package step permissions: id-token: write actions: read contents: read needs: [build-and-release] uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] with: run-scripts: "set-version, ci, build" secrets: inherit ``` ## Related Issue Fixes # <!-- or --> Relates to # ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [ ] Unit, Integration, [docs](https://github.com/defenseunicorns/pepr/tree/main/docs), [adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or updated as needed - [ ] [Contributor Guide Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request) followed Signed-off-by: Case Wylie <[email protected]>
1 parent 5d83b69 commit ceae07b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ jobs:
9696
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9797
run: ./.github/workflows/scripts/release.sh "${PEPR_VERSION}"
9898

99-
slsa:
99+
slsa: # This is where the slsa tarball is built for publish-package step
100100
permissions:
101101
id-token: write
102102
actions: read
103103
contents: read
104104
needs: [build-and-release]
105105
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
106106
with:
107-
run-scripts: "ci, build"
107+
run-scripts: "set-version, ci, build"
108108
secrets: inherit
109109

110110
publish:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"gen-data-json": "node hack/build-template-data.js",
3838
"prebuild": "rm -fr dist/* && npm run gen-data-json",
3939
"prepare": "if [ \"$NODE_ENV\" != 'production' ]; then husky; fi",
40+
"set-version": "bash -lc 'ver=${PEPR_VERSION:-}; if [ -z \"$ver\" ]; then git fetch --tags --force; ver=$(git describe --tags --abbrev=0); fi; ver=${ver#v}; echo Using version $ver; node ./scripts/set-version.js \"$ver\"'",
4041
"test": "npm run test:unit && npm run test:integration",
4142
"test:artifacts": "npm run build && vitest run src/build-artifact.test.ts",
4243
"test:docs": "vitest run --config=config/vitest.integration.config.ts integration/cli/docs/*.test.ts",

0 commit comments

Comments
 (0)