mirror of
https://github.com/RetroDECK/Vita3K-bin.git
synced 2025-01-19 12:45:38 +00:00
Refactor fetch-release workflow to improve variable handling and update commit reference format
This commit is contained in:
parent
535fcfd068
commit
a45c1036d4
12
.github/workflows/fetch-release.yml
vendored
12
.github/workflows/fetch-release.yml
vendored
|
@ -25,8 +25,8 @@ jobs:
|
||||||
id: fetch_release
|
id: fetch_release
|
||||||
run: |
|
run: |
|
||||||
latest_release=$(curl -s https://api.github.com/repos/Vita3K/Vita3K/releases/latest)
|
latest_release=$(curl -s https://api.github.com/repos/Vita3K/Vita3K/releases/latest)
|
||||||
echo "tag_name=$(echo $latest_release | jq -r .tag_name)"
|
tag_name="$(echo $latest_release | jq -r .tag_name)"
|
||||||
echo "release_body=$(echo $latest_release | jq -r .body)"
|
release_body="$(echo $latest_release | jq -r .body)"
|
||||||
|
|
||||||
# fetching assets
|
# fetching assets
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
|
@ -35,11 +35,11 @@ jobs:
|
||||||
done
|
done
|
||||||
|
|
||||||
release_name=$(echo $latest_release | jq -r .body | grep -oP 'Vita3K Build: \d+' | sed 's/Vita3K Build: /Vita3K Build /')
|
release_name=$(echo $latest_release | jq -r .body | grep -oP 'Vita3K Build: \d+' | sed 's/Vita3K Build: /Vita3K Build /')
|
||||||
echo "release_name=$release_name"
|
release_name="$release_name"
|
||||||
commit_hash=$(echo $latest_release | jq -r .body | grep -oP 'corresponding commit \K[0-9a-f]{40}')
|
|
||||||
|
commit_hash=$(echo $latest_release | jq -r .body | grep -oP 'Corresponding commit: \K[0-9a-f]{40}')
|
||||||
if [ -n "$commit_hash" ]; then
|
if [ -n "$commit_hash" ]; then
|
||||||
release_body=$(echo $latest_release | jq -r .body | sed "s/corresponding commit $commit_hash/corresponding commit https:\/\/github.com\/Vita3K\/Vita3K\/commit\/$commit_hash/")
|
release_body+="\n\nCorresponding commit: [$commit_hash](https://github.com/Vita3K/Vita3K/commit/$commit_hash)"
|
||||||
echo "release_body=$release_body"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "tag_name=$tag_name" >> $GITHUB_ENV
|
echo "tag_name=$tag_name" >> $GITHUB_ENV
|
||||||
|
|
Loading…
Reference in a new issue