generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 290
40 lines (36 loc) · 1.59 KB
/
notify-user-new-environment-created.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Send Message on Onboarding Issue Close
on:
workflow_dispatch:
issues:
types:
- closed
permissions:
contents: read
jobs:
send-message:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
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: |
// app.js
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hello @${{ github.event.issue.user.login }} 👋 Welcome to the Modernisation Platform! Your new accounts have now been created. \
Please see our [user guidance](https://user-guide.modernisation-platform.service.justice.gov.uk/#getting-started) for details on how to build and access infrastructure in the Modernisation Platform. \
If you require help or assistance please contact us via the [#ask-modernisation-platform]((https://moj.enterprise.slack.com/archives/C01A7QK5VM1)) Slack channel. '
});