Skip to content

Commit 4ee748a

Browse files
committed
Refactored branch listing.
1 parent 84b0400 commit 4ee748a

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

action.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ runs:
137137
then
138138
cd _branch
139139
140-
BRANCHES=$(git branch --remotes --format=%\(refname:lstrip=-1\))
140+
BRANCHES=$(git ls-remote --branches | grep -oE "[^/]+$")
141141
142142
ls | while read -r branch
143143
do
@@ -146,11 +146,6 @@ runs:
146146
147147
if [[ $? -ne 0 ]]
148148
then
149-
echo "Grep exit code $?"
150-
echo "Deleting branch $branch"
151-
echo "Branches:"
152-
echo $BRANCHES
153-
154149
# Branch no longer exists; delete from GitHub Pages.
155150
rm -rf "$branch"
156151
fi
@@ -165,14 +160,8 @@ runs:
165160
166161
if [[ "$branch" == "${{ inputs.default-branch }}" ]]
167162
then
168-
echo "Pre-move"
169-
ls -R
170163
# Move entire _branch directory.
171164
mv _branch "../${{ inputs.pages-path }}"
172-
echo "Post-move"
173-
ls -R
174-
echo "Site post-move"
175-
ls -R "../${{ inputs.pages-path }}"
176165
else
177166
# Remove previous branch content if it exists and replace it with newly generated content.
178167
rm -rf "_branch/$branch"

0 commit comments

Comments
 (0)