Skip to content

Commit ba2bc9a

Browse files
authored
ci: don't spam slack with long outputs in verify-signatures (#978)
1 parent f015f8f commit ba2bc9a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/scripts/verify-signatures.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ FAILED_LIST=/tmp/verify-failed
3636
else
3737
echo "✅ All kernels verified successfully."
3838
fi
39-
} 2>&1 | tee /tmp/verify-output.log
39+
} 2>&1
4040

4141
[ -s "$FAILED_LIST" ] && exit 1 || exit 0

.github/workflows/verify-signatures.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ jobs:
3737
run: .github/scripts/verify-signatures.sh
3838

3939
- name: Post results to Slack
40-
if: always()
40+
if: failure()
4141
env:
4242
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_SECURITY }}
4343
run: |
44-
nix run nixpkgs#jq -- -Rs '{"text": .}' /tmp/verify-output.log | \
44+
RUN_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
45+
FAILED_KERNELS=$(sed 's/^/• /' /tmp/verify-failed)
46+
MESSAGE=$(printf '❌ Kernel verification failed:\n%s\n\n%s' "$FAILED_KERNELS" "$RUN_URL")
47+
nix run nixpkgs#jq -- -rn --arg text "$MESSAGE" '{"text": $text}' | \
4548
curl -X POST -H 'Content-type: application/json' -d @- "$SLACK_WEBHOOK_URL"

0 commit comments

Comments
 (0)