DXP Release Commenter #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'DXP Release Commenter' | |
on: | |
milestone: | |
types: [closed] | |
jobs: | |
labeler: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v3 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const jiraIssueMatch = context.payload.milestone.title.match(/^LPS-\d+/); | |
if (jiraIssueMatch) { | |
const LPS = jiraIssueMatch; | |
const issues = await github.issues.listForRepo({ | |
milestone: context.payload.milestone.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
state: 'closed' | |
}); | |
if (issues.data) { | |
for (const issue of issues.data) { | |
await github.issues.createComment({ | |
issue_number: issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `This issue has been merged and will be released in DXP at https://issues.liferay.com/browse/${LPS}` | |
}); | |
} | |
} | |
} |