From 3eb2cdf2e5f7d5cdb822161c17236ff939194a8c Mon Sep 17 00:00:00 2001 From: michel Date: Fri, 3 May 2024 17:36:33 +0200 Subject: [PATCH] adjusted due to deprecation of `setOutput` --- .github/workflows/add-release-reviewers.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/add-release-reviewers.yml b/.github/workflows/add-release-reviewers.yml index 7c9b058863fc2..44bc6991e4011 100644 --- a/.github/workflows/add-release-reviewers.yml +++ b/.github/workflows/add-release-reviewers.yml @@ -13,26 +13,23 @@ jobs: if: ${{ github.event.label.name == 'release' }} runs-on: ubuntu-latest permissions: - contents: write + contents: read pull-requests: write steps: - id: get-members run: | - echo ::setOutput name=data::$(\ - gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /orgs/${{ORG}}/teams/${{TEAM_SLUG}}/members \ - | jq 'reduce inputs as $i (.; . += $i)') + DATA=$(gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /orgs/${{ORG}}/teams/${{TEAM_SLUG}}/members \ + | jq 'reduce inputs as $i (.; . += $i)') \ + | echo "data=$DATA" >> $GITHUB_OUTPUT \ + | echo "members=${{ join(fromJson(DATA).*.login) }}" >> $GITHUB_OUTPUT \ env: ORG: ${{ github.event.organization }} TEAM_SLUG: x GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # parse return value and construct a string of login values - - id: construct-members - run: echo '::setOutput name=members::${{ join(fromJson(steps.get-members.outputs.data).*.login) }}' - # assign reviewers - id: assign-reviewers run: | @@ -42,7 +39,7 @@ jobs: -H "Authorization: Bearer ${{GITHUB_TOKEN}}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/${{ORG}}/${{REPO}}/pulls/${{PR_NUMBER}}/requested_reviewers \ - -d '{"reviewers":[${{ steps.construct-members.outputs.members }}]}' \ + -d '{"reviewers":[${{ steps.get-members.outputs.members }}]}' \ env: ORG: ${{ github.event.organization }} REPO: ${{ github.repository }}