TEST - DO NOT APPLY THIS #9
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: Send Message on Onboarding Issue Close | |
on: | |
issues: | |
types: | |
- closed | |
jobs: | |
send-message: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Send message to user on onboarding issue close | |
env: | |
github-token: ${{ secrets.github_token }} | |
if: contains(github.event.issue.labels.*.name, 'onboarding') && github.event.issue.state == 'closed' | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
script: | | |
// Get the user who opened the issue | |
const user = issue.user.login; | |
// Send a message as a comment when the onboarding issue is closed | |
const message = 'Hello @${user}! | |
Welcome to the Modernisation Platform! Your new accounts have now been created. Please see the user guidance for details on how to build and access infrastructure in the | |
Modernisation Platform - https://user-guide.modernisation-platform.service.justice.gov.uk/#getting-started | |
If you need any help or assistance please contact us in the #ask-modernisation-platform slack channel (https://moj.enterprise.slack.com/archives/C01A7QK5VM1)'; | |
github.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: issue.number, | |
body: message, | |
}); |