Skip to content

Commit f7bdd3d

Browse files
Avoid template injection in publish-stable-release
1 parent 000dcc1 commit f7bdd3d

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/publish-stable-release.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ jobs:
2424
# echo ${{ github.event.client_payload.appVersionNumber }}
2525
- name: Load release info
2626
id: releasenotes
27+
env:
28+
APP_VERSION_NUMBER: ${{ github.event.client_payload.appVersionNumber }}
2729
run: |
28-
buildNumber="$(fastlane run app_store_build_number api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" app_identifier:"G7YU7X7KRJ.SworIM" live:false version:"${{ github.event.client_payload.appVersionNumber }}" 2>&1 | tee /dev/stderr | grep Result | sed -E 's/^.*Result: ([0-9]+).*$/\1/g')"
30+
buildNumber="$(fastlane run app_store_build_number api_key_path:"/Users/ci/appstoreconnect/key.json" team_id:"S8D843U34Y" app_identifier:"G7YU7X7KRJ.SworIM" live:false version:"${APP_VERSION_NUMBER}" 2>&1 | tee /dev/stderr | grep Result | sed -E 's/^.*Result: ([0-9]+).*$/\1/g')"
2931
mkdir -p /Users/ci/releases
3032
OUTPUT_FILE="/Users/ci/releases/$buildNumber.output"
3133
touch "$OUTPUT_FILE"
@@ -37,16 +39,18 @@ jobs:
3739
needs: [extractChangelog]
3840
permissions:
3941
contents: write
42+
env:
43+
RELEASE_ID: ${{ needs.extractChangelog.outputs.release-id }}
4044
steps:
4145
- name: Promote draft release to live release
4246
run: |
43-
echo "ID: ${{ needs.extractChangelog.outputs.release-id }}"
47+
echo "ID: ${RELEASE_ID}"
4448
curl -L \
4549
-X PATCH \
4650
-H "Accept: application/vnd.github+json" \
4751
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
4852
-H "X-GitHub-Api-Version: 2022-11-28" \
49-
"https://api.github.com/repos/${{ github.repository }}/releases/${{ needs.extractChangelog.outputs.release-id }}" \
53+
"https://api.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}" \
5054
-d '{"draft": false, "prerelease": false, "make_latest": true}'
5155
5256
notifyMuc:
@@ -76,9 +80,10 @@ jobs:
7680
id: changelog
7781
env:
7882
NOTES: ${{ needs.extractChangelog.outputs.release-notes }}
83+
RELEASE_TAG: ${{ needs.extractChangelog.outputs.release-tag }}
7984
run: |
8085
if [ "${#NOTES}" -gt 400 ]; then
81-
NOTES="To see the complete list of bugfixes and improvements, check our releases page: https://github.com/monal-im/Monal/releases/tag/${{ needs.extractChangelog.outputs.release-tag }}"
86+
NOTES="To see the complete list of bugfixes and improvements, check our releases page: https://github.com/monal-im/Monal/releases/tag/${RELEASE_TAG}"
8287
fi
8388
echo "notes<<__EOF__" | tee /dev/stderr >> "$GITHUB_OUTPUT"
8489
echo "$NOTES" >> "$GITHUB_OUTPUT"
@@ -93,7 +98,11 @@ jobs:
9398
visibility: "public"
9499
language: "en"
95100
- name: Get toot information
101+
env:
102+
TOOT_ID: ${{ steps.toot.outputs.id }}
103+
TOOT_URL: ${{ steps.toot.outputs.url }}
104+
SCHEDULED_AT: ${{ steps.toot.outputs.scheduled_at }}
96105
run: |
97-
echo "Toot ID: ${{ steps.toot.outputs.id }}"
98-
echo "Toot URL: ${{ steps.toot.outputs.url }}"
99-
echo "Scheduled at: ${{ steps.toot.outputs.scheduled_at }}"
106+
echo "Toot ID: ${TOOT_ID}"
107+
echo "Toot URL: ${TOOT_URL}"
108+
echo "Scheduled at: ${SCHEDULED_AT}"

0 commit comments

Comments
 (0)