Skip to content

Commit 21a7132

Browse files
authored
ci: Use GITHUB_OUTPUT envvar instead of set-output command
`save-state` and `set-output` commands used in GitHub Actions are deprecated and [GitHub recommends using environment files](https://github.blog/changelog/2023-07-24-github-actions-update-on-save-state-and-set-output-commands/). This PR updates the usage of `::set-output` to `"$GITHUB_OUTPUT"` Instructions for envvar usage from GitHub docs: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
1 parent e700354 commit 21a7132

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/shielding-check-cron-manual.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
run: |
1818
cat ./temp.json | jq . > etc/shielding/datacenters.json
1919
rm -f ./temp.json
20-
echo "::set-output name=diff-count::$(git diff --name-only | wc -l)"
20+
echo "diff-count=$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT"
2121
SHA1=`sha1sum etc/shielding/datacenters.json | awk '{print $1}'`
22-
echo "::set-output name=sha1::$SHA1"
23-
echo "::set-output name=pr-count::$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)"
22+
echo "sha1=$SHA1" >> "$GITHUB_OUTPUT"
23+
echo "pr-count=$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)" >> "$GITHUB_OUTPUT"
2424
env:
2525
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2626
- name: Check diff and create PR

.github/workflows/shielding-check-cron.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
run: |
2121
cat ./temp.json | jq . > etc/shielding/datacenters.json
2222
rm -f ./temp.json
23-
echo "::set-output name=diff-count::$(git diff --name-only | wc -l)"
23+
echo "diff-count=$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT"
2424
SHA1=`sha1sum etc/shielding/datacenters.json | awk '{print $1}'`
25-
echo "::set-output name=sha1::$SHA1"
26-
echo "::set-output name=pr-count::$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)"
25+
echo "sha1=$SHA1" >> "$GITHUB_OUTPUT"
26+
echo "pr-count=$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)" >> "$GITHUB_OUTPUT"
2727
env:
2828
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
- name: Check diff and create PR

0 commit comments

Comments
 (0)