Skip to content

Commit

Permalink
tools: do not use the set-output command in workflows
Browse files Browse the repository at this point in the history
The `set-output` command is deprecated. Use the `GITHUB_OUTPUT`
environment file.

Refs: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
PR-URL: #45024
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
lpinca authored and RafaelGSS committed Nov 10, 2022
1 parent d41f8ff commit a70b276
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/auto-start-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ jobs:
- name: Get Pull Requests
id: get_prs_for_ci
run: >
gh pr list \
numbers=$(gh pr list \
--repo ${{ github.repository }} \
--label 'request-ci' \
--json 'number' \
-t '::set-output name=numbers::{{ range . }}{{ .number }} {{ end }}' \
--limit 100
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
echo "numbers=$numbers" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
start-ci:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- name: Compute number of commits in the PR
id: nb-of-commits
run: |
echo "::set-output name=plusOne::$((${{ github.event.pull_request.commits }} + 1))"
echo "::set-output name=minusOne::$((${{ github.event.pull_request.commits }} - 1))"
echo "plusOne=$((${{ github.event.pull_request.commits }} + 1))" >> $GITHUB_OUTPUT
echo "minusOne=$((${{ github.event.pull_request.commits }} - 1))" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
with:
fetch-depth: ${{ steps.nb-of-commits.outputs.plusOne }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/commit-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ jobs:
- name: Get Pull Requests
id: get_mergeable_prs
run: >
gh pr list \
numbers=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--json 'number' \
-t '::set-output name=numbers::{{ range . }}{{ .number }} {{ end }}' \
--limit 100
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
echo "numbers=$numbers" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
commitQueue:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-flaky-test-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
labels="${labels}${platform2label[$platform]},"; \
done;
echo "::set-output name=LABELS::${labels::-1}"
echo "LABELS=${labels::-1}" >> $GITHUB_OUTPUT
- name: Add labels
env:
Expand Down

0 comments on commit a70b276

Please sign in to comment.