diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 638dbe5..95f161b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,11 +59,21 @@ jobs: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} # GitHub sets this automatically GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} - - name: Add published label to pull request - run: | - export PR_NUMBER=$(gh pr list --state merged --label 'autorelease: tagged' --json number --jq '.[0].number') - gh pr edit $PR_NUMBER --remove-label 'autorelease: tagged' - gh pr edit $PR_NUMBER --add-label 'autorelease: published' - env: + label: + if: ${{ needs.release-please.outputs.release_created }} + name: Label PR + needs: goreleaser + runs-on: ubuntu-latest + + env: GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + steps: + - name: Get PR number + id: pr + run: | + echo "pr_number=$(gh pr list --state merged --label 'autorelease: tagged' --json number --jq '.[0].number')" >> $GITHUB_OUTPUT + - run: "gh pr edit ${{ steps.pr.outputs.pr_number }} --remove-label 'autorelease: tagged'" + - run: "gh pr edit ${{ steps.pr.outputs.pr_number }} --add-label 'autorelease: published'" + +