generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 290
66 lines (46 loc) · 1.84 KB
/
confirm-contacts-for-environments.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Confirm Contacts for Environments
on:
# Runs on the first day of each month at 9am
schedule:
- cron: '0 9 1 * *'
# Allows for manual exec
workflow_dispatch:
env:
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_KEY: ${{ secrets.GOV_UK_NOTIFY_API_KEY }}
TEMPLATE_ID: "93afef96-ea0b-470f-bd20-edf44e0acdb9"
PERIOD: "6" # This variable determines the number of months we look back for created dates. For production it will be 6.
defaults:
run:
shell: bash
jobs:
confirm-contacts-for-environments:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
repository-projects: read
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# 1. Iterate through all environments/*.json files and get the environment name & contact details for each as a json file.
- name: Get Environment Owners
run: |
cd $GITHUB_WORKSPACE
pwd
./scripts/confirm-environment-owner/get-environment-owners.sh
# 2. Setup Python.
- name: Install Python
uses: actions/setup-python@v5.3.0 # Need to add this to dependabot
with:
python-version: '3.10' # Note - we need a means to check these python versions and keep them current.
- name: Install the Notifications Client
run: pip install notifications-python-client
# 3. Create an issue in github with the requried text and notify the owners via email with the issue link.
- name: Create Issue and Notify Owner
run: |
cd $GITHUB_WORKSPACE
pwd
chmod +x scripts/confirm-environment-owner/create-confirm-owner-issue.sh
./scripts/confirm-environment-owner/create-confirm-owner-issue.sh