Skip to content

Commit

Permalink
Merge pull request #60 from bcgov-nr/fix/releaseMessages
Browse files Browse the repository at this point in the history
fix: current workflow has no issue for release to use
  • Loading branch information
mbystedt authored Jul 4, 2024
2 parents 64d3364 + 6ed9113 commit 5097433
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions generators/gh-maven-build/templates/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,59 +160,3 @@ jobs:
uses: bcgov-nr/action-broker-intention-close@v1
with:
intention_token: ${{ env.INTENTION_TOKEN }}
message:
name: Message
runs-on: ubuntu-latest
needs: build-release
steps:
- name: Pull request
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
uses: actions/github-script@v7
with:
script: |
// Get a list of all issues created by the PR opener
// See: https://octokit.github.io/rest.js/#pagination
const creator = context.payload.sender.login
const opts = github.rest.issues.listForRepo.endpoint.merge({
...context.issue,
creator,
state: 'all'
})
const issues = await github.paginate(opts)
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This build is ready to be deployed up to the test environment using the 'Deploy' action. After merging to main, create a release in GitHub to deploy to production.`
})
for (const issue of issues) {
if (issue.number === context.issue.number) {
continue
}
if (issue.pull_request) {
return // Creator is already a contributor.
}
}
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `**Welcome**, new contributor!
Please make sure you've read our [contributing guide](CONTRIBUTING.md). We look forward to reviewing your pull request shortly.`
})
- name: Release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This build is ready to be deployed using the 'Deploy' action. After approval, it can be deployed to production.`
})

0 comments on commit 5097433

Please sign in to comment.