From d6f09707357145a1463ca57b698d43a9b1e571e2 Mon Sep 17 00:00:00 2001 From: Jennifer Carlucci Date: Wed, 25 Feb 2026 16:45:54 -0700 Subject: [PATCH 1/4] slack notify on linter errors --- CONTRIBUTING.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cad2f99492..6f0126ff4e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,17 @@ Please note that this project is released with a [Contributor Code of Conduct][c We will gladly accept pull requests for contributions to other files in this repository. +## CI notifications + +The `Notify on linter failure` workflow posts failed pull request lint runs to `#api-platform` through chatterbox. + +To enable notifications, configure these repository-level Actions secrets: + +- `CHATTERBOX_URL` +- `CHATTERBOX_TOKEN` + +This workflow is defined in `.github/workflows/linter-failure-notifier.yml`. + ### Submitting a pull request 0. [Fork][fork] and clone the repository From fe57989a735e21f975e0f9cf11427270732c369d Mon Sep 17 00:00:00 2001 From: Jennifer Carlucci Date: Wed, 25 Feb 2026 16:47:38 -0700 Subject: [PATCH 2/4] add broken yaml for testing --- .github/workflows/linter-failure-notifier.yml | 44 +++++++++++++++++++ .github/workflows/linter.yml | 1 + descriptions-next/lint-failure-test.yaml | 1 + 3 files changed, 46 insertions(+) create mode 100644 .github/workflows/linter-failure-notifier.yml create mode 100644 descriptions-next/lint-failure-test.yaml diff --git a/.github/workflows/linter-failure-notifier.yml b/.github/workflows/linter-failure-notifier.yml new file mode 100644 index 0000000000..19d0441303 --- /dev/null +++ b/.github/workflows/linter-failure-notifier.yml @@ -0,0 +1,44 @@ +name: Notify on linter failure +permissions: + contents: read + +on: + workflow_run: + workflows: + - Lint OpenAPI Descriptions + types: + - completed + +jobs: + notify: + name: Notify #api-platform about failed PR lint + if: | + github.event.workflow_run.conclusion == 'failure' && + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.repository.full_name == 'github/rest-api-description' + runs-on: ubuntu-latest + steps: + - name: Post failure to chatterbox + env: + CHATTERBOX_URL: ${{ secrets.CHATTERBOX_URL }} + CHATTERBOX_TOKEN: ${{ secrets.CHATTERBOX_TOKEN }} + RUN_URL: ${{ github.event.workflow_run.html_url }} + RUN_NAME: ${{ github.event.workflow_run.name }} + BRANCH: ${{ github.event.workflow_run.head_branch }} + COMMIT: ${{ github.event.workflow_run.head_sha }} + PR_URL: ${{ github.event.workflow_run.pull_requests[0].html_url }} + REPO: ${{ github.event.workflow_run.repository.full_name }} + run: | + if [ -z "$CHATTERBOX_URL" ] || [ -z "$CHATTERBOX_TOKEN" ]; then + echo "CHATTERBOX_URL or CHATTERBOX_TOKEN is not configured; skipping notification." + exit 0 + fi + + short_sha="${COMMIT:0:7}" + message=":warning: Linter workflow failed for a pull request in ${REPO}.\n• Workflow: ${RUN_NAME}\n• PR: ${PR_URL}\n• Branch: ${BRANCH}\n• Commit: ${short_sha}\n• Run: ${RUN_URL}" + + curl --fail --silent --show-error \ + -X POST \ + -u "${CHATTERBOX_TOKEN}:" \ + "${CHATTERBOX_URL%/}/topics/%23api-platform" \ + --data "$message" diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index e9b8c9d2f1..803a506d12 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,6 +5,7 @@ permissions: on: - push + - pull_request jobs: lint: diff --git a/descriptions-next/lint-failure-test.yaml b/descriptions-next/lint-failure-test.yaml new file mode 100644 index 0000000000..146c655953 --- /dev/null +++ b/descriptions-next/lint-failure-test.yaml @@ -0,0 +1 @@ +trigger: [this is intentionally broken From 1bd821650b2a8bf418485d43f9c5ec8277fdd1f1 Mon Sep 17 00:00:00 2001 From: Jennifer Carlucci Date: Wed, 25 Feb 2026 16:53:26 -0700 Subject: [PATCH 3/4] update lint workflow so it can be triggered manually --- .github/workflows/linter-failure-notifier.yml | 14 +++++++++++--- .github/workflows/linter.yml | 5 +++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linter-failure-notifier.yml b/.github/workflows/linter-failure-notifier.yml index 19d0441303..7690a2ea3e 100644 --- a/.github/workflows/linter-failure-notifier.yml +++ b/.github/workflows/linter-failure-notifier.yml @@ -11,10 +11,10 @@ on: jobs: notify: - name: Notify #api-platform about failed PR lint + name: Notify #api-platform about failed lint if: | github.event.workflow_run.conclusion == 'failure' && - github.event.workflow_run.event == 'pull_request' && + contains(fromJSON('["pull_request", "workflow_dispatch"]'), github.event.workflow_run.event) && github.event.workflow_run.repository.full_name == 'github/rest-api-description' runs-on: ubuntu-latest steps: @@ -28,6 +28,7 @@ jobs: COMMIT: ${{ github.event.workflow_run.head_sha }} PR_URL: ${{ github.event.workflow_run.pull_requests[0].html_url }} REPO: ${{ github.event.workflow_run.repository.full_name }} + TRIGGER_EVENT: ${{ github.event.workflow_run.event }} run: | if [ -z "$CHATTERBOX_URL" ] || [ -z "$CHATTERBOX_TOKEN" ]; then echo "CHATTERBOX_URL or CHATTERBOX_TOKEN is not configured; skipping notification." @@ -35,7 +36,14 @@ jobs: fi short_sha="${COMMIT:0:7}" - message=":warning: Linter workflow failed for a pull request in ${REPO}.\n• Workflow: ${RUN_NAME}\n• PR: ${PR_URL}\n• Branch: ${BRANCH}\n• Commit: ${short_sha}\n• Run: ${RUN_URL}" + + if [ -n "$PR_URL" ]; then + target_line="• PR: ${PR_URL}" + else + target_line="• Trigger: ${TRIGGER_EVENT}" + fi + + message=":warning: Linter workflow failed in ${REPO}.\n• Workflow: ${RUN_NAME}\n${target_line}\n• Branch: ${BRANCH}\n• Commit: ${short_sha}\n• Run: ${RUN_URL}" curl --fail --silent --show-error \ -X POST \ diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 803a506d12..1e0b2d48e1 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,8 +4,9 @@ permissions: contents: read on: - - push - - pull_request + push: + pull_request: + workflow_dispatch: jobs: lint: From 3488d9492574af0ebf6d21950e18da63b571ff1a Mon Sep 17 00:00:00 2001 From: Jennifer Carlucci Date: Wed, 25 Feb 2026 17:27:24 -0700 Subject: [PATCH 4/4] remove test yaml --- descriptions-next/lint-failure-test.yaml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 descriptions-next/lint-failure-test.yaml diff --git a/descriptions-next/lint-failure-test.yaml b/descriptions-next/lint-failure-test.yaml deleted file mode 100644 index 146c655953..0000000000 --- a/descriptions-next/lint-failure-test.yaml +++ /dev/null @@ -1 +0,0 @@ -trigger: [this is intentionally broken