From 020753a5fd194307a1f3aed1213d1690ab7909ae Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Mon, 30 Sep 2024 16:47:36 -0500 Subject: [PATCH] ci: add reminder to deploy TF cloud changes (#2625) * ci: add reminder to deploy TF cloud changes * ci: update checkout version * ci: fastly --- .github/workflows/deployminder.yml | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/deployminder.yml diff --git a/.github/workflows/deployminder.yml b/.github/workflows/deployminder.yml new file mode 100644 index 000000000..04774f04f --- /dev/null +++ b/.github/workflows/deployminder.yml @@ -0,0 +1,37 @@ +name: Deploy Reminder + +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + remind: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for changes in infra/ + id: check_changes + run: | + git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -q '^infra/' + echo "has_infra_changes=$?" >> $GITHUB_OUTPUT + + - name: Comment on PR + if: steps.check_changes.outputs.has_infra_changes == '0' + uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Changes detected in the `infra/` directory. Don\'t forget to apply these changes in Terraform Cloud and/or Fastly!' + })