File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,10 @@ jobs:
5555 # Necessary for Docker manifest
5656 DOCKER_CLI_EXPERIMENTAL : " enabled"
5757 steps :
58- - name : Prevent non-dry-run releases on branches
59- if : ${{ github.action_ref != 'main' && !inputs.dry_run }}
58+ - name : Check release on main (or dry-run)
59+ if : ${{ github.ref_name != 'main' && !inputs.dry_run }}
6060 run : |
61- echo "Release not allowed on ${{ github.action_ref }}, use dry-run."
61+ echo "Release not allowed on ${{ github.ref_name }}, use dry-run."
6262 exit 1
6363
6464 - uses : actions/checkout@v3
Original file line number Diff line number Diff line change @@ -131,11 +131,18 @@ maybedryrun() {
131131 log " DRYRUN: $* "
132132 else
133133 shift
134- log $ " $@ "
135- " $@ "
134+ logrun " $@ "
136135 fi
137136}
138137
138+ # logrun prints the given program and flags, and then executes it.
139+ #
140+ # Usage: logrun gh release create ...
141+ logrun () {
142+ log $ " $* "
143+ " $@ "
144+ }
145+
139146# log prints a message to stderr.
140147log () {
141148 echo " $* " 1>&2
Original file line number Diff line number Diff line change 167167fi
168168
169169log
170- # Use maybedryrun to echo the command.
171- maybedryrun 0 gh workflow run release.yaml \
170+ logrun gh workflow run release.yaml \
172171 --ref " $branch " \
173172 -F increment=" $increment " \
174173 " ${args[@]} "
You can’t perform that action at this time.
0 commit comments