Skip to content

Commit

Permalink
ci(workflows): handle status:prereleased label in release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Aug 13, 2022
1 parent c53273d commit ee539d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,28 +174,30 @@ jobs:
pr: ${{ github.event.inputs.pr || github.event.number }}
repo: ${{ github.event.repository.name }}
- id: label-linked-issues
name: Add status:released label to linked issues
name: Label linked issues
uses: actions/github-script@v6.1.0
env:
DATA: ${{ steps.query-linked-issues.outputs.data }}
PRERELEASE: ${{ needs.metadata.outputs.prerelease }}
with:
script: |
const { closingIssuesReferences } = JSON.parse(process.env.DATA).repository.pullRequest
const issues = closingIssuesReferences.edges.map(edge => edge.node.number)
const prerelease = JSON.parse(process.env.PRERELEASE || 'false')
for (const issue_number of issues) {
await github.rest.issues.addLabels({
...context.repo,
issue_number,
labels: ['status:released']
labels: [`status:${prerelease ? 'pre' : ''}released`]
})
}
- id: close-released-issues
name: Close issues with status:released label
name: Close released issues
uses: bdougie/close-issues-based-on-label@master
env:
LABEL: status:released
LABEL: status:${{ (needs.metadata.outputs.prerelease && 'prereleased') || 'released' }}
- id: delete-release-branch
name: Delete release/${{ needs.metadata.outputs.version }}
uses: dawidd6/action-delete-branch@v3.1.0
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ Before releasing, the following steps must be completed:
- pack project
- create and push new tag
- create and publish github release
- add the `status:released` label to all linked issues
- make sure all issues with the `status:released` label are closed
- enable auto-merge for the release branch
- add `status:prereleased` or `status:released` label to linked issues
- make sure all prereleased or released issues are closed
- delete release branch
[1]: https://brew.sh
[2]:
Expand Down

0 comments on commit ee539d5

Please sign in to comment.