Skip to content

Commit 6f41834

Browse files
authored
try to use the target_commitish property (#9)
1 parent 6292273 commit 6f41834

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

.github/actions/release_to_prod/action.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,24 @@ runs:
1111
# echo "${{github.ref_name}}" -> 7/merge
1212
# git rev-parse --abbrev-ref HEAD -> HEAD
1313
run: |
14-
echo "${{ toJson(github) }}"
15-
echo "${{github.ref}}"
16-
echo "${{github.head_ref}}"
17-
echo "${{github.ref_name}}"
18-
git rev-parse --abbrev-ref HEAD
19-
git branch --show-current
14+
echo "${{github.event}}"
2015
shell: bash
2116

2217
- name: Do some release stuff for main
23-
if: github.ref == 'main'
18+
if: github.event.target_commitish == "main"
2419
run: |
2520
echo "this is the release script for main"
2621
shell: bash
2722

2823

2924
- name: Do some release stuff for a hotfix
30-
if: contains(github.head_ref, 'hotfix') == true
25+
if: contains(github.event.target_commitish, 'hotfix') == true
3126
run: |
3227
echo "this is the release script for a HOTFIX"
3328
shell: bash
3429

3530
- name: Warn about other branches
36-
if: contains(github.head_ref, 'hotfix') == false && github.head_ref != 'main'
31+
if: github.event.target_commitish != "main"
3732
run: |
3833
echo "Can only release main or hotfix"
3934
shell: bash

0 commit comments

Comments
 (0)