Skip to content

Commit 8a85b5c

Browse files
committed
Migrate workflows from deprecated set-output commands
GitHub Actions provides the capability for workflow authors to use the capabilities of the GitHub Actions ToolKit package directly in the `run` keys of workflows via "workflow commands". One such command is `set-output`, which allows data to be passed out of a workflow step as an output. It has been determined that this command has potential to be a security risk in some applications. For this reason, GitHub has deprecated the command and a warning of this is shown in the workflow run summary page of any workflow using it: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ The identical capability is now provided in a safer form via the GitHub Actions "environment files" system. Migrating the use of the deprecated workflow commands to use the `GITHUB_OUTPUT` environment file instead fixes any potential vulnerabilities in the workflows, resolves the warnings, and avoids the eventual complete breakage of the workflows that would result from GitHub's planned removal of the `set-output` workflow command 2023-05-31.
1 parent b998d35 commit 8a85b5c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Diff for: .github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
OUTPUT_SAFE_BODY="${BODY//'%'/'%25'}"
184184
OUTPUT_SAFE_BODY="${OUTPUT_SAFE_BODY//$'\n'/'%0A'}"
185185
OUTPUT_SAFE_BODY="${OUTPUT_SAFE_BODY//$'\r'/'%0D'}"
186-
echo "::set-output name=BODY::$OUTPUT_SAFE_BODY"
186+
echo "BODY=$OUTPUT_SAFE_BODY" >> $GITHUB_OUTPUT
187187
echo "$BODY" > CHANGELOG.txt
188188
189189
- name: Upload Changelog [GitHub Actions]
@@ -228,7 +228,7 @@ jobs:
228228
- name: Get Tag
229229
id: tag_name
230230
run: |
231-
echo ::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/}
231+
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
232232
233233
- name: Publish Release [GitHub]
234234
uses: svenstaro/[email protected]

Diff for: .github/workflows/check-certificates.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
echo "Certificate expiration date: $EXPIRATION_DATE"
109109
echo "Days remaining before expiration: $DAYS_BEFORE_EXPIRATION"
110110
111-
echo "::set-output name=days::$DAYS_BEFORE_EXPIRATION"
111+
echo "days=$DAYS_BEFORE_EXPIRATION" >> $GITHUB_OUTPUT
112112
113113
- name: Check if expiration notification period has been reached
114114
id: check-expiration

Diff for: .github/workflows/compose-full-changelog.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Get Tag
2828
id: tag_name
2929
run: |
30-
echo ::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/}
30+
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
3131
3232
- name: Create full changelog
3333
id: full-changelog

Diff for: .github/workflows/sync-labels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
run: |
104104
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
105105
# configuration.
106-
echo "::set-output name=flag::--dry-run"
106+
echo "flag=--dry-run" >> $GITHUB_OUTPUT
107107
108108
- name: Checkout repository
109109
uses: actions/checkout@v3

0 commit comments

Comments
 (0)