From af717525d2541c61bbe18aa03d1b57029c3c8879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Kivim=C3=A4ki?= Date: Thu, 11 Jul 2024 13:04:26 +0300 Subject: [PATCH] chore(ci): update PR tag after publish --- .github/workflows/release.yml | 22 ++++++++++++++++++---- .goreleaser.yaml | 2 ++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4e893a8..2c8d3f72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,11 +67,25 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - uses: actions/github-script@v7 + name: Update release label on PR with: script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, + const { data: { items } } = await github.rest.search.issuesAndPullRequests({ + q: `${context.sha} type:pr is:merged` + }); + + const issue = { + issue_number: items[0].number, owner: context.repo.owner, repo: context.repo.repo, - labels: ["autorelease: published"] - }) + }; + + github.rest.issues.addLabels({ + ...issue, + labels: ["autorelease: published"], + }); + + github.rest.issues.removeLabel({ + ...issue, + name: "autorelease: tagged", + }); diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 514cdb7b..300747d8 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,5 @@ +version: 2 + builds: - id: jalapeno dir: cmd/jalapeno