Skip to content

Commit 940cad5

Browse files
Change the restore logic
1 parent 0ea5fce commit 940cad5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/restore.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,22 @@ jobs:
8585
run: |
8686
version="${{ inputs.version }}"
8787
size="${{ inputs.size }}"
88-
V3_8_COMPATIBLE="3.6 3.7 3.8 3.9 3.10"
89-
echo "$V3_8_COMPATIBLE" | tr " " '\n' | grep -F -q -x "$version"
90-
exit_code="$?"
91-
if [ "$exit_code" -eq "0" ]; then
92-
echo "Version $version is acceptable"
88+
V3_6_COMPATIBLE="3.6 3.7"
89+
V3_8_COMPATIBLE="3.8 3.9 3.10"
90+
if echo "$V3_8_COMPATIBLE" | grep -q -w "$version"; then
91+
echo "Version $version is acceptable by 3.8 backup"
9392
file_version=3.8
94-
echo "version=3.8" >> "$GITHUB_OUTPUT"
95-
echo "name=v$file_version-$size.tar.gz" >> "$GITHUB_OUTPUT"
93+
elif echo "$V3_6_COMPATIBLE" | grep -q -w "$version"; then
94+
echo "Version $version is acceptable by 3.6 backup"
95+
file_version=3.6
9696
else
9797
echo "Version $version is not acceptable"
9898
exit 1
9999
fi
100100
101+
echo "version=$file_version" >> "$GITHUB_OUTPUT"
102+
echo "name=v$file_version-$size.tar.gz" >> "$GITHUB_OUTPUT"
103+
101104
- name: Download from blob storage
102105
run: |
103106
mkdir ghes-data

0 commit comments

Comments
 (0)