Confirm Contacts for Environments #88
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: 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 | |