File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -25,22 +25,27 @@ jobs:
2525 - name : Run build
2626 run : yarn build
2727 - name : Push build files to GitHub
28+ shell : bash
2829 run : |
2930 set -ex
3031
31- if [[ "$GITHUB_REF" != 'refs/heads/main' && "$GITHUB_REF" != 'refs/heads/1.0' && "$GITHUB_REF" != 'refs/heads/2.0' ]]; then
32+ BASE_BRANCH_PATTERN="^refs\/heads\/(main|[0-9]+\.[0-9])$"
33+ if ! [[ "$GITHUB_REF" =~ $BASE_BRANCH_PATTERN ]]; then
3234 echo "not pushing because ref is $GITHUB_REF"
3335 exit 0
3436 fi
3537
38+ set +e
3639 git status -s | grep Resources/Public/JavaScript
3740 if [ $? -eq 0 ]; then
41+ set -e
3842 git config --global user.name "github-actions[bot]"
3943 git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
4044 git add -f Resources/Public/JavaScript
41- git commit -m "Update: Build frontend files"
45+ git commit -m "Update: Build frontend files for $GITHUB_SHA on $GITHUB_REF_NAME "
4246 git push
4347 else
48+ set -e
4449 echo "No changes since last run"
4550 fi
4651
You can’t perform that action at this time.
0 commit comments