Skip to content

Commit c9ff3cf

Browse files
committed
Commitbot features
1 parent c89e626 commit c9ff3cf

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/commit-bot.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name: Commit Bot
88
# "If an action pushes code using the repository's GITHUB_TOKEN, a new workflow will not run"
99
#
1010
# - Processing of either the 'master' or 'develop' branch may be stopped by creating the variables
11-
# vars.block_master or vars.block_develop with any value.
11+
# vars.block_master or vars.block_develop with the value "yes" (case-insensitive).
1212
# https://github.com/boostorg/boost/settings/variables/actions
1313
#
1414

@@ -33,24 +33,26 @@ jobs:
3333
run: |
3434
set -xe
3535
branches=""
36+
block_master="${{ vars.block_master }}"
37+
block_develop="${{ vars.block_develop }}"
3638
if [[ "${{ github.event_name }}" == "push" ]]; then
37-
if [[ ! -n "${{ vars.block_master }}" && "${{ github.ref_name }}" == "master" ]]; then
39+
# The job doesn't run on "push" so this will not execute.
40+
if [[ ! ${block_master,,} =~ "yes" && "${{ github.ref_name }}" == "master" ]]; then
3841
branches="master"
39-
elif [[ ! -n "${{ vars.block_develop }}" && "${{ github.ref_name }}" == "develop" ]]; then
42+
elif [[ ! ${block_develop,,} =~ "yes" && "${{ github.ref_name }}" == "develop" ]]; then
4043
branches="develop"
41-
else
42-
branches="${{ github.ref_name }}"
4344
fi
4445
else
4546
# from a schedule:
46-
if [[ ! -n "${{ vars.block_master }}" ]]; then
47+
if [[ ! ${block_master,,} =~ "yes" ]]; then
4748
branches="master"
4849
fi
49-
if [[ ! -n "${{ vars.block_develop }}" ]]; then
50+
if [[ ! ${block_develop,,} =~ "yes" ]]; then
5051
branches="${branches} develop"
5152
fi
5253
fi
5354
echo "branches=$branches" >> $GITHUB_OUTPUT
55+
echo "branches is ${branches}"
5456
5557
- name: Checkout master repository
5658
uses: actions/checkout@v4

0 commit comments

Comments
 (0)