Skip to content

Commit

Permalink
ci: Use GITHUB_OUTPUT envvar instead of set-output command
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
arunsathiya authored Feb 6, 2024
1 parent e700354 commit 21a7132
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/shielding-check-cron-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
run: |
cat ./temp.json | jq . > etc/shielding/datacenters.json
rm -f ./temp.json
echo "::set-output name=diff-count::$(git diff --name-only | wc -l)"
echo "diff-count=$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT"
SHA1=`sha1sum etc/shielding/datacenters.json | awk '{print $1}'`
echo "::set-output name=sha1::$SHA1"
echo "::set-output name=pr-count::$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)"
echo "sha1=$SHA1" >> "$GITHUB_OUTPUT"
echo "pr-count=$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check diff and create PR
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/shielding-check-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
run: |
cat ./temp.json | jq . > etc/shielding/datacenters.json
rm -f ./temp.json
echo "::set-output name=diff-count::$(git diff --name-only | wc -l)"
echo "diff-count=$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT"
SHA1=`sha1sum etc/shielding/datacenters.json | awk '{print $1}'`
echo "::set-output name=sha1::$SHA1"
echo "::set-output name=pr-count::$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)"
echo "sha1=$SHA1" >> "$GITHUB_OUTPUT"
echo "pr-count=$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check diff and create PR
Expand Down

0 comments on commit 21a7132

Please sign in to comment.