Skip to content

Commit

Permalink
chore: Tidy up the PR labels (#490)
Browse files Browse the repository at this point in the history
Remove the `autorelease: pending` and add `autorelease: tagged`
  • Loading branch information
mnorbury authored Dec 5, 2024
1 parent 73c8061 commit 1de6e6c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release_please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,40 @@ jobs:
skip_existing: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Get PR data
uses: actions/github-script@v7
if: startsWith(github.event.head_commit.message, 'chore(main): Release')
id: get_pr_data
with:
script: |
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0];
- name: Update PR labels
uses: actions/github-script@v7
if: startsWith(github.event.head_commit.message, 'chore(main): Release')
with:
script: |
const prNumber = ${{ fromJson(steps.get_pr_data.outputs.result).number }};
// Remove the pending label
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
name: 'autorelease: pending'
});
// Add the tagged label
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
labels: ['autorelease: tagged']
});

0 comments on commit 1de6e6c

Please sign in to comment.