Skip to content

Merge pull request #8622 from ministryofjustice/accounts/sprinkler-en… #743

Merge pull request #8622 from ministryofjustice/accounts/sprinkler-en…

Merge pull request #8622 from ministryofjustice/accounts/sprinkler-en… #743

name: New environment files
on:
push:
paths:
- 'environments/**.json'
- 'environments-networks/**.json'
branches:
- main
workflow_dispatch:
permissions: {}
defaults:
run:
shell: bash
jobs:
create-and-commit-files:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Provision environment directories
run: bash ./scripts/provision-environment-directories.sh
- name: Commit changes to GitHub
run: bash ./scripts/git-setup.sh
- run: bash ./scripts/git-commit.sh terraform/environments
- run: bash ./scripts/git-pull-request.sh terraform/environments
env:
SECRET: ${{ secrets.GITHUB_TOKEN }}
- name: Slack failure notification
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: incoming-webhook
payload: |
{"blocks":[{"type": "section","text": {"type": "mrkdwn","text": ":no_entry: Failed GitHub Action:"}},{"type": "section","fields":[{"type": "mrkdwn","text": "*Workflow:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>"},{"type": "mrkdwn","text": "*Job:*\n${{ github.job }}"},{"type": "mrkdwn","text": "*Repo:*\n${{ github.repository }}"}]}]}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: ${{ failure() }}