File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 18
18
- ubuntu-latest
19
19
20
20
steps :
21
+ - name : Check branch name # make sure the release can only be run on branches like 'release-*'
22
+ run : |
23
+ ref="${{ github.ref }}"
24
+ if [[ ! "$ref" =~ ^refs/heads/release-* ]]; then
25
+ echo "Error: Workflow can only run on branches starting with 'release-*'"
26
+ exit 1
27
+ fi
21
28
- uses : actions/checkout@v4
22
-
23
29
- name : Use Node.js ${{ matrix.node-version }}
24
30
uses : actions/setup-node@v4
25
31
with :
36
42
needs : lint-build-test # previous job MUST pass to make a release!
37
43
runs-on : ubuntu-latest
38
44
39
- # Skip running release workflow on forks
40
- if : github.repository_owner == 'salesforce' && github.event_name == 'push '
45
+ # This workflow can only be triggered manually in the source (non forked) repository.
46
+ if : github.repository_owner == 'salesforce' && github.event_name == 'workflow_dispatch '
41
47
42
48
permissions :
43
49
contents : write # to be able to publish a GitHub release
66
72
run : npx semantic-release
67
73
env :
68
74
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
69
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
75
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments