Skip to content

Commit c9663a3

Browse files
authored
[skip changelog] Migrate workflows from deprecated set-output commands (#1940)
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 61ba685 commit c9663a3

11 files changed

+15
-15
lines changed

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/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

Diff for: .github/workflows/check-go-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
RESULT="false"
4848
fi
4949
50-
echo "::set-output name=result::$RESULT"
50+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5151
5252
check-errors:
5353
name: check-errors (${{ matrix.module.path }})

Diff for: .github/workflows/check-protobuf-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
RESULT="false"
4343
fi
4444
45-
echo "::set-output name=result::$RESULT"
45+
echo "result=$RESULT" >> $GITHUB_OUTPUT
4646
4747
build:
4848
needs: run-determination

Diff for: .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
RESULT="false"
4646
fi
4747
48-
echo "::set-output name=result::$RESULT"
48+
echo "result=$RESULT" >> $GITHUB_OUTPUT
4949
5050
publish:
5151
runs-on: ubuntu-latest
@@ -93,7 +93,7 @@ jobs:
9393

9494
- name: Determine versioning parameters
9595
id: determine-versioning
96-
run: echo "::set-output name=data::$(poetry run python docs/siteversion/siteversion.py)"
96+
run: echo "data=$(poetry run python docs/siteversion/siteversion.py)" >> $GITHUB_OUTPUT
9797

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

Diff for: .github/workflows/publish-go-nightly-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
id: get-version
5757
env:
5858
NIGHTLY: true
59-
run: echo "::set-output name=version::$(task general:get-version)"
59+
run: echo "version=$(task general:get-version)" >> $GITHUB_OUTPUT
6060

6161
- name: Upload artifacts
6262
uses: actions/upload-artifact@v3

Diff for: .github/workflows/publish-go-tester-task.yml

+2-2
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
package-name-prefix:
5757
needs: run-determination
@@ -69,7 +69,7 @@ jobs:
6969
fi
7070
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
7171
72-
echo "::set-output name=prefix::$PACKAGE_NAME_PREFIX"
72+
echo "prefix=$PACKAGE_NAME_PREFIX" >> $GITHUB_OUTPUT
7373
7474
build:
7575
needs: package-name-prefix

Diff for: .github/workflows/release-go-task.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161

6262
- name: Output Version
6363
id: get-version
64-
run: echo "::set-output name=version::$(task general:get-version)"
64+
run: echo "version=$(task general:get-version)" >> $GITHUB_OUTPUT
6565

6666
- name: Upload artifacts
6767
uses: actions/upload-artifact@v3
@@ -254,7 +254,7 @@ jobs:
254254
run: |
255255
wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.0.0.zip
256256
unzip -p /tmp/3.0.0.zip semver-tool-3.0.0/src/semver >/tmp/semver && chmod +x /tmp/semver
257-
if [[ "$(/tmp/semver get prerel ${{ needs.create-release-artifacts.outputs.version }} )" ]]; then echo "::set-output name=IS_PRE::true"; fi
257+
if [[ "$(/tmp/semver get prerel ${{ needs.create-release-artifacts.outputs.version }} )" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi
258258
259259
- name: Create Github Release and upload artifacts
260260
uses: ncipollo/release-action@v1

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

Diff for: .github/workflows/test-go-integration-task.yml

+2-2
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
tests-collector:
6161
runs-on: ubuntu-latest
@@ -70,7 +70,7 @@ jobs:
7070
- name: Collect tests
7171
id: collection
7272
run: |
73-
echo "::set-output name=tests-data::$(python .github/tools/get_integration_tests.py ./test/)"
73+
echo "tests-data=$(python .github/tools/get_integration_tests.py ./test/)" >> $GITHUB_OUTPUT
7474
7575
test:
7676
needs: tests-collector

Diff for: .github/workflows/test-go-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
test:
6262
needs: run-determination

0 commit comments

Comments
 (0)