@@ -60,26 +60,26 @@ runs:
6060
6161 if [[ -f package.json ]]
6262 then
63- NPM_SCRIPTS =$(npm run)
63+ npm_scripts =$(npm run)
6464
6565 if [[ $? -eq 0 ]]
6666 then
67- if [[ "$NPM_SCRIPTS " == "" ]]
67+ if [[ "$npm_scripts " == "" ]]
6868 then
6969 echo "No scripts found."
70- GREP_RESULT =1
70+ grep_result =1
7171 else
7272 # Check for package-defined build.
73- echo "$NPM_SCRIPTS " | grep -q "^ pandoc-spec-action$"
74- GREP_RESULT =$?
73+ echo "$npm_scripts " | grep -q "^ pandoc-spec-action$"
74+ grep_result =$?
7575 fi
7676 else
7777 # npm command failed.
7878 exit $?
7979 fi
8080 else
8181 # No package.json.
82- GREP_RESULT =1
82+ grep_result =1
8383 fi
8484
8585 if [[ -f $PWD/node_modules/.bin/pandoc-spec ]]
9191 npm install @legreq/pandoc-spec --global
9292 fi
9393
94- if [[ $GREP_RESULT -eq 0 ]]
94+ if [[ $grep_result -eq 0 ]]
9595 then
9696 echo "Running pandoc-spec-action npm script"
9797 npm run pandoc-spec-action
@@ -100,9 +100,6 @@ runs:
100100 pandoc-spec
101101 fi
102102
103- - name : Start terminal session (post API)
104- uses : mxschmitt/action-tmate@v3
105-
106103 - name : Merge branches
107104 if : inputs.include-pages == 'true' && inputs.include-branches == 'true' && github.ref_type == 'branch'
108105 shell : bash
@@ -140,15 +137,17 @@ runs:
140137 then
141138 cd _branch
142139
143- BRANCHES =$(git ls-remote --branches | grep -oE "[^/]+$")
140+ branches =$(git ls-remote --branches | grep -oE "[^/]+$")
144141
145142 ls | while read -r branch
146143 do
147- # Check than branch still exists.
148- echo "BRANCHES " | grep -q "^$branch$"
144+ # Check that branch still exists.
145+ echo "$branches " | grep -q "^$branch$"
149146
150147 if [[ $? -ne 0 ]]
151148 then
149+ echo "Deleting stale branch $branch"
150+
152151 # Branch no longer exists; delete from GitHub Pages.
153152 rm -rf "$branch"
154153 fi
0 commit comments