File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed
Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -19,30 +19,22 @@ jobs:
1919 with :
2020 ref : ${{ github.event.inputs.tag }}
2121
22+ - name : Validate semver pattern
23+ run : npx semver ${{ inputs.tag }}
24+
2225 - name : Check package version
2326 id : cpv
2427 uses : PostHog/check-package-version@v2
2528
26- - run : npm install semver
27-
28- - name : Validate tag
29+ - name : Validate package version
2930 uses : actions/github-script@v6
3031 with :
3132 script : |
32- const semver = require('semver')
33-
34- const tag = `${context.payload.inputs.tag}`;
35- const version = tag.substring(1);
36-
37- if (semver.valid(version)) {
38- const isNewVersion = `${{ steps.cpv.outputs.is-new-version }}`;
39- if (isNewVersion === 'true') {
33+ const isNewVersion = `${{ steps.cpv.outputs.is-new-version }}`;
34+ if (isNewVersion === 'true') {
4035 console.log(`Version ${context.payload.inputs.tag} has not been published yet`);
41- } else {
42- core.setFailed(`Version ${context.payload.inputs.tag} is already published`);
43- }
4436 } else {
45- core.setFailed(`Tag ${context.payload.inputs.tag} does not match semver pattern `);
37+ core.setFailed(`Version ${context.payload.inputs.tag} is already published `);
4638 }
4739 check-status :
4840 needs : check-version
10597 egress-policy : block
10698 allowed-endpoints : >
10799 github.com:443
108- hooks.slack.com:443
109100 nodejs.org:443
110101 prod.api.stepsecurity.io:443
111102 registry.npmjs.org:443
You can’t perform that action at this time.
0 commit comments