Skip to content

Commit 7003158

Browse files
committed
Don't use deprecated ::set-output in CI
1 parent 46af39a commit 7003158

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/workflows/forms-backend.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
id: sha_tag
6363
run: |
6464
tag=$(cut -c 1-7 <<< $GITHUB_SHA)
65-
echo "::set-output name=tag::$tag"
65+
echo "sha-tag=$tag" >> $GITHUB_OUTPUT
6666
6767
- name: Checkout repository
6868
uses: actions/checkout@v4
@@ -102,7 +102,7 @@ jobs:
102102
id: sha_tag
103103
run: |
104104
tag=$(cut -c 1-7 <<< $GITHUB_SHA)
105-
echo "::set-output name=tag::$tag"
105+
echo "sha-tag=$tag" >> $GITHUB_OUTPUT
106106
107107
- name: Checkout repository
108108
uses: actions/checkout@v4

.github/workflows/status-embed.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17+
# A workflow_run event does not contain all the information
18+
# we need for a PR embed. That's why we upload an artifact
19+
# with that information in the Lint workflow.
1720
- name: Get Pull Request Information
1821
id: pr_info
1922
if: github.event.workflow_run.event == 'pull_request'
2023
run: |
2124
curl -s -H "Authorization: token $GITHUB_TOKEN" ${{ github.event.workflow_run.artifacts_url }} > artifacts.json
2225
DOWNLOAD_URL=$(cat artifacts.json | jq -r '.artifacts[] | select(.name == "pull-request-payload") | .archive_download_url')
2326
[ -z "$DOWNLOAD_URL" ] && exit 1
24-
wget --quiet --header="Authorization: token $GITHUB_TOKEN" -O pull_request_payload.zip $DOWNLOAD_URL || exit 2
27+
curl -sSL -H "Authorization: token $GITHUB_TOKEN" -o pull_request_payload.zip $DOWNLOAD_URL || exit 2
2528
unzip -p pull_request_payload.zip > pull_request_payload.json
2629
[ -s pull_request_payload.json ] || exit 3
27-
echo "::set-output name=pr_author_login::$(jq -r '.user.login // empty' pull_request_payload.json)"
28-
echo "::set-output name=pr_number::$(jq -r '.number // empty' pull_request_payload.json)"
29-
echo "::set-output name=pr_title::$(jq -r '.title // empty' pull_request_payload.json)"
30-
echo "::set-output name=pr_source::$(jq -r '.head.label // empty' pull_request_payload.json)"
30+
echo "pr_author_login=$(jq -r '.user.login // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
31+
echo "pr_number=$(jq -r '.number // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
32+
echo "pr_title=$(jq -r '.title // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
33+
echo "pr_source=$(jq -r '.head.label // empty' pull_request_payload.json)" >> $GITHUB_OUTPUT
3134
env:
3235
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3336

@@ -42,14 +45,14 @@ jobs:
4245
webhook_id: '784184528997842985'
4346
webhook_token: ${{ secrets.GHA_WEBHOOK_TOKEN }}
4447

45-
# Workflow information
48+
# We need to provide the information of the workflow that
49+
# triggered this workflow instead of this workflow.
4650
workflow_name: ${{ github.event.workflow_run.name }}
4751
run_id: ${{ github.event.workflow_run.id }}
4852
run_number: ${{ github.event.workflow_run.run_number }}
4953
status: ${{ github.event.workflow_run.conclusion }}
5054
sha: ${{ github.event.workflow_run.head_sha }}
5155

52-
# Now we can use the information extracted in the previous step:
5356
pr_author_login: ${{ steps.pr_info.outputs.pr_author_login }}
5457
pr_number: ${{ steps.pr_info.outputs.pr_number }}
5558
pr_title: ${{ steps.pr_info.outputs.pr_title }}

0 commit comments

Comments
 (0)