From bf3a9991764e4d6c22a442d9dea8fb91930141e7 Mon Sep 17 00:00:00 2001 From: Jordan Ritter Date: Mon, 13 Apr 2026 01:03:58 -0700 Subject: [PATCH] Fix broken Slack webhook curl in all CI workflows Multiline curl with `\ || true` on the first line caused -H to be interpreted as a command when SLACK_WEBHOOK was empty. Wrap each curl block in an if-guard and move || true to the end. --- .github/workflows/deploy-health-check.yml | 16 ++++++++++------ .github/workflows/deploy-pages.yml | 8 +++++--- .github/workflows/notify-pr.yml | 8 +++++--- .github/workflows/publish-docker.yml | 16 ++++++++++------ .github/workflows/publish-release.yml | 16 ++++++++++------ .github/workflows/unreleased-check.yml | 8 +++++--- .github/workflows/update-competitive-matrix.yml | 16 ++++++++++------ 7 files changed, 55 insertions(+), 33 deletions(-) diff --git a/.github/workflows/deploy-health-check.yml b/.github/workflows/deploy-health-check.yml index 0f72499..673ff04 100644 --- a/.github/workflows/deploy-health-check.yml +++ b/.github/workflows/deploy-health-check.yml @@ -21,16 +21,20 @@ jobs: - name: Notify Slack — success if: success() run: | - curl -sf -X POST "$SLACK_WEBHOOK" \ || true - -H 'Content-Type: application/json' \ - -d '{"text":"Pathfinder production deploy healthy — both services OK"}' + if [ -n "$SLACK_WEBHOOK" ]; then + curl -sf -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d '{"text":"Pathfinder production deploy healthy — both services OK"}' || true + fi env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - name: Notify Slack — failure if: failure() run: | - curl -s -X POST "$SLACK_WEBHOOK" \ || true - -H 'Content-Type: application/json' \ - -d "{\"text\":\"Pathfinder production health check FAILED after deploy\n\"}" + if [ -n "$SLACK_WEBHOOK" ]; then + curl -s -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d "{\"text\":\"Pathfinder production health check FAILED after deploy\n\"}" || true + fi env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 1120f4c..15beff8 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -29,6 +29,8 @@ jobs: - name: Notify Slack on failure if: failure() run: | - curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ || true - -H "Content-Type: application/json" \ - -d "{\"text\":\"❌ *Pathfinder GitHub Pages deploy failed*\n\"}" + if [ -n "${{ secrets.SLACK_WEBHOOK }}" ]; then + curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ + -H "Content-Type: application/json" \ + -d "{\"text\":\"❌ *Pathfinder GitHub Pages deploy failed*\n\"}" || true + fi diff --git a/.github/workflows/notify-pr.yml b/.github/workflows/notify-pr.yml index 95652c5..b607dd7 100644 --- a/.github/workflows/notify-pr.yml +++ b/.github/workflows/notify-pr.yml @@ -9,8 +9,10 @@ jobs: - name: Notify Slack if: github.actor != 'github-actions[bot]' run: | - curl -sf -X POST "$SLACK_WEBHOOK" \ || true - -H 'Content-Type: application/json' \ - -d "{\"text\":\"New PR on pathfinder: *${{ github.event.pull_request.title }}* by ${{ github.actor }}\n<${{ github.event.pull_request.html_url }}|View PR #${{ github.event.pull_request.number }}>\"}" + if [ -n "$SLACK_WEBHOOK" ]; then + curl -sf -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d "{\"text\":\"New PR on pathfinder: *${{ github.event.pull_request.title }}* by ${{ github.actor }}\n<${{ github.event.pull_request.html_url }}|View PR #${{ github.event.pull_request.number }}>\"}" || true + fi env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 35ea325..f7ca730 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -29,16 +29,20 @@ jobs: - name: Notify Slack — success if: success() run: | - curl -sf -X POST "$SLACK_WEBHOOK" \ || true - -H 'Content-Type: application/json' \ - -d "{\"text\":\"Docker image published: ghcr.io/copilotkit/pathfinder:${{ github.ref_name }}\"}" + if [ -n "$SLACK_WEBHOOK" ]; then + curl -sf -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d "{\"text\":\"Docker image published: ghcr.io/copilotkit/pathfinder:${{ github.ref_name }}\"}" || true + fi env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - name: Notify Slack — failure if: failure() run: | - curl -sf -X POST "$SLACK_WEBHOOK" \ || true - -H 'Content-Type: application/json' \ - -d "{\"text\":\"Docker publish failed\n\"}" + if [ -n "$SLACK_WEBHOOK" ]; then + curl -sf -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d "{\"text\":\"Docker publish failed\n\"}" || true + fi env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 95da13b..f3b6c4e 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -66,13 +66,17 @@ jobs: if: steps.check.outputs.published == 'false' run: | VERSION="v${{ steps.check.outputs.version }}" - curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ || true - -H "Content-Type: application/json" \ - -d "{\"text\":\"📦 *@copilotkit/pathfinder ${VERSION} published*\nnpm: https://www.npmjs.com/package/@copilotkit/pathfinder/v/${{ steps.check.outputs.version }}\nRelease: https://github.com/${{ github.repository }}/releases/tag/${VERSION}\"}" + if [ -n "${{ secrets.SLACK_WEBHOOK }}" ]; then + curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ + -H "Content-Type: application/json" \ + -d "{\"text\":\"📦 *@copilotkit/pathfinder ${VERSION} published*\nnpm: https://www.npmjs.com/package/@copilotkit/pathfinder/v/${{ steps.check.outputs.version }}\nRelease: https://github.com/${{ github.repository }}/releases/tag/${VERSION}\"}" || true + fi - name: Notify Slack on failure if: failure() run: | - curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ || true - -H "Content-Type: application/json" \ - -d "{\"text\":\"❌ *Pathfinder release failed*\n\"}" + if [ -n "${{ secrets.SLACK_WEBHOOK }}" ]; then + curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \ + -H "Content-Type: application/json" \ + -d "{\"text\":\"❌ *Pathfinder release failed*\n\"}" || true + fi diff --git a/.github/workflows/unreleased-check.yml b/.github/workflows/unreleased-check.yml index a518143..9d9c7d4 100644 --- a/.github/workflows/unreleased-check.yml +++ b/.github/workflows/unreleased-check.yml @@ -41,8 +41,10 @@ jobs: - name: Notify Slack — unreleased changes if: steps.unreleased.outputs.count run: | - curl -sf -X POST "$SLACK_WEBHOOK" \ || true - -H 'Content-Type: application/json' \ - -d "{\"text\":\"Unreleased changes on main — ${{ steps.unreleased.outputs.count }} commits since ${{ steps.unreleased.outputs.tag }}\n\"}" + if [ -n "$SLACK_WEBHOOK" ]; then + curl -sf -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d "{\"text\":\"Unreleased changes on main — ${{ steps.unreleased.outputs.count }} commits since ${{ steps.unreleased.outputs.tag }}\n\"}" || true + fi env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/update-competitive-matrix.yml b/.github/workflows/update-competitive-matrix.yml index e93797c..13e142e 100644 --- a/.github/workflows/update-competitive-matrix.yml +++ b/.github/workflows/update-competitive-matrix.yml @@ -35,16 +35,20 @@ jobs: - name: Notify Slack — changes detected if: steps.changes.outputs.changed == 'true' run: | - curl -sf -X POST "$SLACK_WEBHOOK" \ || true - -H 'Content-Type: application/json' \ - -d "{\"text\":\"Competitive matrix updated — PR created\n<${{ steps.pr.outputs.url }}|View PR>\"}" + if [ -n "$SLACK_WEBHOOK" ]; then + curl -sf -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d "{\"text\":\"Competitive matrix updated — PR created\n<${{ steps.pr.outputs.url }}|View PR>\"}" || true + fi env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - name: Notify Slack — failure if: failure() run: | - curl -sf -X POST "$SLACK_WEBHOOK" \ || true - -H 'Content-Type: application/json' \ - -d "{\"text\":\"Competitive matrix scan failed\n\"}" + if [ -n "$SLACK_WEBHOOK" ]; then + curl -sf -X POST "$SLACK_WEBHOOK" \ + -H 'Content-Type: application/json' \ + -d "{\"text\":\"Competitive matrix scan failed\n\"}" || true + fi env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}