Skip to content

Env var for the issue title plus some log formatting. #81

Env var for the issue title plus some log formatting.

Env var for the issue title plus some log formatting. #81

name: Confirm Contacts for Environments
on:
workflow_dispatch:
push:
branches:
- issue/7047
#schedule:
# - cron: '00 9 */30,1-7 * 1' # First Monday of month
env:
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
with:
ref: issue/7047
# 1. Iterate through all environments/*.json files and get the environment name & contact details for each as a json file.
- name: Get Environment Owners
env:
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd $GITHUB_WORKSPACE
pwd
chmod +x scripts/confirm-environment-owner/get-environment-owners.sh
./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
env:
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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