File tree 3 files changed +13
-7
lines changed
3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,10 @@ jobs:
55
55
# Necessary for Docker manifest
56
56
DOCKER_CLI_EXPERIMENTAL : " enabled"
57
57
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 }}
60
60
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."
62
62
exit 1
63
63
64
64
- uses : actions/checkout@v3
Original file line number Diff line number Diff line change @@ -131,11 +131,18 @@ maybedryrun() {
131
131
log " DRYRUN: $* "
132
132
else
133
133
shift
134
- log $ " $@ "
135
- " $@ "
134
+ logrun " $@ "
136
135
fi
137
136
}
138
137
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
+
139
146
# log prints a message to stderr.
140
147
log () {
141
148
echo " $* " 1>&2
Original file line number Diff line number Diff line change 167
167
fi
168
168
169
169
log
170
- # Use maybedryrun to echo the command.
171
- maybedryrun 0 gh workflow run release.yaml \
170
+ logrun gh workflow run release.yaml \
172
171
--ref " $branch " \
173
172
-F increment=" $increment " \
174
173
" ${args[@]} "
You can’t perform that action at this time.
0 commit comments