Skip to content

Commit 8d56e0f

Browse files
committed
Made pages archive configurable.
1 parent 94d9769 commit 8d56e0f

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

action.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ inputs:
2323
description: Default branch for include-branches to filter; ignored if include-branches is false. Default is "main".
2424
required: false
2525
default: "main"
26+
pages-archive:
27+
description: Pages archive name; ignored if include-branches is false. Default is "_pages". Temporary directory with this name will be created during build and ZIP file with this name will be published to the root.
28+
required: false
29+
default: "_pages"
2630

2731
runs:
2832
using: composite
@@ -114,18 +118,20 @@ runs:
114118
pages_url="https://$host_name/$repository_name"
115119
fi
116120
121+
pages_archive=${{ inputs.pages-archive }}
122+
117123
# Get and unzip GitHub Pages archive.
118-
curl -s $pages_url/_pages.zip -o _pages.zip
124+
curl -s $pages_url/"$pages_archive".zip -o "$pages_archive".zip
119125
if [[ $? -eq 0 ]]
120126
then
121-
unzip -qq _pages.zip -d _pages
122-
rm _pages.zip
127+
unzip -qq "$pages_archive".zip -d "$pages_archive"
128+
rm "$pages_archive".zip
123129
else
124130
# First time including branches. Treat current content as default branch; will be fixed on next push to default branch.
125-
cp -r "${{ inputs.pages-path }}" _pages/
131+
cp -r "${{ inputs.pages-path }}" "$pages_archive"/
126132
fi
127133
128-
cd _pages
134+
cd "$pages_archive"
129135
130136
if [[ -d _branch ]]
131137
then
@@ -168,8 +174,8 @@ runs:
168174
169175
cd "../${{ inputs.pages-path }}"
170176
171-
zip -q -r ../_pages .
172-
mv ../_pages.zip .
177+
zip -q -r ../"$pages_archive" .
178+
mv ../"$pages_archive".zip .
173179
174180
cd ..
175181

0 commit comments

Comments
 (0)