Skip to content

Commit e309eee

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 dee5390 commit e309eee

8 files changed

+9
-9
lines changed

.github/workflows/check-go-dependencies-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
RESULT="false"
5757
fi
5858
59-
echo "::set-output name=result::$RESULT"
59+
echo "result=$RESULT" >> $GITHUB_OUTPUT
6060
6161
check-cache:
6262
needs: run-determination

.github/workflows/check-notarization-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

.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
RESULT="false"
4949
fi
5050
51-
echo "::set-output name=result::$RESULT"
51+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5252
5353
publish:
5454
runs-on: ubuntu-latest
@@ -83,7 +83,7 @@ jobs:
8383

8484
- name: Determine versioning parameters
8585
id: determine-versioning
86-
run: echo "::set-output name=data::$(poetry run python docs/siteversion/siteversion.py)"
86+
run: echo "data=$(poetry run python docs/siteversion/siteversion.py)" >> $GITHUB_OUTPUT
8787

8888
- name: Publish documentation
8989
if: fromJson(steps.determine-versioning.outputs.data).version != null

.github/workflows/publish-go-tester-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
RESULT="false"
5353
fi
5454
55-
echo "::set-output name=result::$RESULT"
55+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5656
5757
build:
5858
needs: run-determination

.github/workflows/release-go-crosscompile-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ jobs:
210210
run: |
211211
wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip
212212
unzip -p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver >/tmp/semver && chmod +x /tmp/semver
213-
if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "::set-output name=IS_PRE::true"; fi
213+
if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi
214214
215215
- name: Create Github Release and upload artifacts
216216
uses: ncipollo/release-action@v1

.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

.github/workflows/test-go-integration-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
RESULT="false"
5656
fi
5757
58-
echo "::set-output name=result::$RESULT"
58+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5959
6060
test:
6161
needs: run-determination

.github/workflows/test-go-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
RESULT="false"
5252
fi
5353
54-
echo "::set-output name=result::$RESULT"
54+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5555
5656
test:
5757
name: test (${{ matrix.module.path }} - ${{ matrix.operating-system }})

0 commit comments

Comments
 (0)