From 4bf4dc71455ee884f3e967a300a25a42c2764172 Mon Sep 17 00:00:00 2001 From: addetz <43963729+addetz@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:44:30 +0100 Subject: [PATCH] docs: add slack notification --- .github/workflows/clean-up-unused-images.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/clean-up-unused-images.yaml b/.github/workflows/clean-up-unused-images.yaml index ecdec8de5bd..b0da883ac92 100644 --- a/.github/workflows/clean-up-unused-images.yaml +++ b/.github/workflows/clean-up-unused-images.yaml @@ -94,14 +94,21 @@ jobs: Please review this PR carefully before merging it.' output=$(gh pr create --base master --title "docs: clean up librarium unused images " --body "$pr_body" --label "$backport_labels") - echo $output pr_url=$(echo "$output" | grep -o "https://[^ ]*") - echo $pr_url - - echo "CREATED_CLEANUP_PR=pr_url" >> $GITHUB_ENV - - echo "PR successfully created $CREATED_CLEANUP_PR." + echo "PR successfully created $pr_url." + echo "GITHUB_CREATED_CLEANUP_PR=$pr_url" >> $GITHUB_ENV env: GH_TOKEN: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }} + - name: Slack Notification + if: $GITHUB_CREATED_CLEANUP_PR != "" + uses: rtCamp/action-slack-notify@v2.3.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_PRIVATE_TEAM_WEBHOOK }} + SLACK_USERNAME: "spectromate" + SLACK_ICON_EMOJI: ":ok_hand:" + SLACK_COLOR: ${{ job.status }} + SLACKIFY_MARKDOWN: true + ENABLE_ESCAPES: true + SLACK_MESSAGE: 'A new PR with unused images to clean up was created. Please review $env.GITHUB_CREATED_CLEANUP_PR for more details.' \ No newline at end of file