From eae76e12b942527e142957f23f1393d3f2af00d8 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Mon, 27 Jul 2026 15:48:51 -0700 Subject: [PATCH] Send Slack notification on GHCR cleanup failure The periodic GHCR cleanup job is otherwise entirely silent. Send a notification if it fails. --- .../example-uws/.github/workflows/ghcr-cleanup.yaml | 10 ++++++++++ .../example/.github/workflows/ghcr-cleanup.yaml | 10 ++++++++++ .../.github/workflows/ghcr-cleanup.yaml | 11 +++++++++++ project_templates/technote_md/testn-000/technote.toml | 2 +- .../technote_rst/testn-000/technote.toml | 2 +- 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/project_templates/fastapi_safir_app/example-uws/.github/workflows/ghcr-cleanup.yaml b/project_templates/fastapi_safir_app/example-uws/.github/workflows/ghcr-cleanup.yaml index 412004c7..c60f46b8 100644 --- a/project_templates/fastapi_safir_app/example-uws/.github/workflows/ghcr-cleanup.yaml +++ b/project_templates/fastapi_safir_app/example-uws/.github/workflows/ghcr-cleanup.yaml @@ -25,3 +25,13 @@ jobs: delete-untagged: true older-than: "6 months" validate: true + + - name: Report status + if: failure() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: "failure" + notification_title: "GHCR cleanup for {repo} failed" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }} diff --git a/project_templates/fastapi_safir_app/example/.github/workflows/ghcr-cleanup.yaml b/project_templates/fastapi_safir_app/example/.github/workflows/ghcr-cleanup.yaml index 412004c7..c60f46b8 100644 --- a/project_templates/fastapi_safir_app/example/.github/workflows/ghcr-cleanup.yaml +++ b/project_templates/fastapi_safir_app/example/.github/workflows/ghcr-cleanup.yaml @@ -25,3 +25,13 @@ jobs: delete-untagged: true older-than: "6 months" validate: true + + - name: Report status + if: failure() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: "failure" + notification_title: "GHCR cleanup for {repo} failed" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }} diff --git a/project_templates/fastapi_safir_app/{{cookiecutter.name}}/.github/workflows/ghcr-cleanup.yaml b/project_templates/fastapi_safir_app/{{cookiecutter.name}}/.github/workflows/ghcr-cleanup.yaml index 412004c7..a26f82bc 100644 --- a/project_templates/fastapi_safir_app/{{cookiecutter.name}}/.github/workflows/ghcr-cleanup.yaml +++ b/project_templates/fastapi_safir_app/{{cookiecutter.name}}/.github/workflows/ghcr-cleanup.yaml @@ -25,3 +25,14 @@ jobs: delete-untagged: true older-than: "6 months" validate: true +{% if cookiecutter.github_org == "lsst-sqre" %} + - name: Report status + if: failure() + uses: ravsamhq/notify-slack-action@v2 + with: + status: {{ "${{ job.status }}" }} + notify_when: "failure" + notification_title: "GHCR cleanup for {repo} failed" + env: + SLACK_WEBHOOK_URL: {{ "${{ secrets.SLACK_ALERT_WEBHOOK }}" }} +{%- endif %} diff --git a/project_templates/technote_md/testn-000/technote.toml b/project_templates/technote_md/testn-000/technote.toml index bbe8d0f0..3fe83766 100644 --- a/project_templates/technote_md/testn-000/technote.toml +++ b/project_templates/technote_md/testn-000/technote.toml @@ -4,7 +4,7 @@ series_id = "TESTN" canonical_url = "https://testn-000.lsst.io" github_url = "https://github.com/lsst/testn-000" github_default_branch = "main" -date_created = 2026-07-24T17:58:10Z +date_created = 2026-07-27T22:49:18Z organization.name = "NSF-DOE Vera C. Rubin Observatory" organization.ror = "https://ror.org/048g3cy84" license.id = "CC-BY-4.0" diff --git a/project_templates/technote_rst/testn-000/technote.toml b/project_templates/technote_rst/testn-000/technote.toml index eaeba3c4..78cae593 100644 --- a/project_templates/technote_rst/testn-000/technote.toml +++ b/project_templates/technote_rst/testn-000/technote.toml @@ -4,7 +4,7 @@ series_id = "TESTN" canonical_url = "https://testn-000.lsst.io" github_url = "https://github.com/lsst/testn-000" github_default_branch = "main" -date_created = 2026-07-24T17:58:10Z +date_created = 2026-07-27T22:49:18Z organization.name = "NSF-DOE Vera C. Rubin Observatory" organization.ror = "https://ror.org/048g3cy84" license.id = "CC-BY-4.0"