Skip to content

Commit 0df161e

Browse files
fix(ci): use env vars for input interpolation in workflow run steps (calcom#26520)
Co-authored-by: Alex van Andel <me@alexvanandel.com>
1 parent b8b9251 commit 0df161e

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/cleanup-report.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ jobs:
3434
- name: Cleanup HTML reports on PR close/merge
3535
env:
3636
BRANCH_REPORTS_DIR: reports/${{ github.event.pull_request.head.ref }}
37+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
3738
run: |
3839
if [ -d "$BRANCH_REPORTS_DIR" ]; then
3940
rm -rf "$BRANCH_REPORTS_DIR"
4041
git add .
41-
git commit -m "workflow: remove all reports for branch ${{ github.event.pull_request.head.ref }} (PR closed/merged)"
42+
git commit -m "workflow: remove all reports for branch $HEAD_REF (PR closed/merged)"
4243
git push
4344
else
44-
echo "No reports found for branch ${{ github.event.pull_request.head.ref }}. Nothing to clean up."
45+
echo "No reports found for branch $HEAD_REF. Nothing to clean up."
4546
fi

.github/workflows/draft-release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,18 @@ jobs:
5656
- uses: ./.github/actions/yarn-install
5757

5858
- name: Bump version
59+
env:
60+
VERSION: ${{ inputs.next_version }}
5961
run: |
6062
cd apps/web
61-
yarn version ${{ inputs.next_version }}
63+
yarn version "$VERSION"
6264
6365
- name: Commit changes
66+
env:
67+
VERSION: ${{ inputs.next_version }}
6468
run: |
6569
git add .
66-
git commit -m "chore: release v${{ inputs.next_version }}"
70+
git commit -m "chore: release v$VERSION"
6771
git push
6872
6973
- name: Draft release

.github/workflows/publish-report.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ jobs:
6363
- name: Cleanup old HTML reports
6464
if: ${{ env.BRANCH_REPORTS_EXIST == 'true' }}
6565
timeout-minutes: 3
66+
env:
67+
HEAD_BRANCH: ${{ inputs.head_branch }}
6668
run: |
67-
rm -rf $BRANCH_REPORTS_DIR
69+
rm -rf "$BRANCH_REPORTS_DIR"
6870
git add .
69-
git commit -m "workflow: remove all reports for branch ${{ inputs.head_branch }}"
71+
git commit -m "workflow: remove all reports for branch $HEAD_BRANCH"
7072
- name: Download zipped HTML report
7173
uses: actions/download-artifact@v4
7274
with:
@@ -76,9 +78,12 @@ jobs:
7678
timeout-minutes: 3
7779
# commit report, then try push-rebase-loop until it's able to merge the HTML report to the gh-pages branch
7880
# this is necessary when this job running at least twice at the same time (e.g. through two pushes at the same time)
81+
env:
82+
RUN_ID: ${{ inputs.source_run_id }}
83+
RUN_ATTEMPT: ${{ inputs.source_run_attempt }}
7984
run: |
8085
git add .
81-
git commit -m "workflow: add HTML report for run-id ${{ inputs.source_run_id }} (attempt: ${{ inputs.source_run_attempt }})"
86+
git commit -m "workflow: add HTML report for run-id $RUN_ID (attempt: $RUN_ATTEMPT)"
8287
8388
while true; do
8489
git pull --rebase

0 commit comments

Comments
 (0)