Skip to content

Commit 094e2de

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 e31e978 commit 094e2de

8 files changed

+10
-10
lines changed

.github/workflows/check-certificates.yml

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

.github/workflows/check-code-generation-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
RESULT="false"
4747
fi
4848
49-
echo "::set-output name=result::$RESULT"
49+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5050
5151
check:
5252
needs: run-determination

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

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

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

+1-1
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
check-errors:
5454
name: check-errors (${{ matrix.module.path }})

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
RESULT="false"
4747
fi
4848
49-
echo "::set-output name=result::$RESULT"
49+
echo "result=$RESULT" >> $GITHUB_OUTPUT
5050
5151
publish:
5252
runs-on: ubuntu-latest
@@ -88,7 +88,7 @@ jobs:
8888

8989
- name: Determine versioning parameters
9090
id: determine-versioning
91-
run: echo "::set-output name=data::$(poetry run python docs/siteversion/siteversion.py)"
91+
run: echo "data=$(poetry run python docs/siteversion/siteversion.py)" >> $GITHUB_OUTPUT
9292

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

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

+2-2
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
package-name-prefix:
5858
needs: run-determination
@@ -71,7 +71,7 @@ jobs:
7171
fi
7272
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
7373
74-
echo "::set-output name=prefix::$PACKAGE_NAME_PREFIX"
74+
echo "prefix=$PACKAGE_NAME_PREFIX" >> $GITHUB_OUTPUT
7575
7676
build:
7777
needs: package-name-prefix

.github/workflows/sync-labels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
run: |
110110
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
111111
# configuration.
112-
echo "::set-output name=flag::--dry-run"
112+
echo "flag=--dry-run" >> $GITHUB_OUTPUT
113113
114114
- name: Checkout repository
115115
uses: actions/checkout@v4

.github/workflows/test-go-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
test:
5858
name: test (${{ matrix.module.path }} - ${{ matrix.operating-system }})

0 commit comments

Comments
 (0)