File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ runs:
111111 repository_name="${{ github.event.repository.name }}"
112112 lower_repository_name=$(echo "$repository_name" | tr "[:upper:]" "[:lower:]")
113113
114- if [[ "$lower_repository_name" == "host_name" ]]
114+ if [[ "$lower_repository_name" == "$ host_name" ]]
115115 then
116116 pages_url="https://$host_name"
117117 else
@@ -121,14 +121,14 @@ runs:
121121 pages_archive=${{ inputs.pages-archive }}
122122
123123 # Get and unzip GitHub Pages archive.
124- curl -s $pages_url/"$pages_archive".zip -o "$pages_archive".zip
125- if [[ $? -eq 0 ]]
126- then
127- unzip -qq "$pages_archive".zip -d "$pages_archive"
128- rm "$pages_archive".zip
124+ # Fail on 404 and similar so we fall back properly
125+ curl -fSL "$pages_url/${{ inputs.pages-archive }}.zip" -o "${{ inputs.pages-archive }}.zip"
126+ if unzip -qq "${{ inputs.pages-archive }}.zip" -d "${{ inputs.pages-archive }}"; then
127+ rm "${{ inputs.pages-archive }}.zip"
129128 else
130- # First time including branches. Treat current content as default branch; will be fixed on next push to default branch.
131- cp -r "${{ inputs.pages-path }}" "$pages_archive"/
129+ echo "No existing pages archive; seeding new one"
130+ mkdir -p "${{ inputs.pages-archive }}"
131+ cp -r "${{ inputs.pages-path }}" "${{ inputs.pages-archive }}/"
132132 fi
133133
134134 cd "$pages_archive"
You can’t perform that action at this time.
0 commit comments