Skip to content

Commit

Permalink
gh-actions: fix slack bump (#6137)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Dec 4, 2024
1 parent dccfb70 commit 634f029
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/bump-agent-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ jobs:
run: ./.github/workflows/bump-agent-versions.sh

- if: ${{ failure() }}
uses: slackapi/slack-github-action@e598089eaef53883a2d9b325e044899548518a03 # v2.0.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
channel-id: '#ingest-notifications'
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"channel": "#ingest-notifications",
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
Expand All @@ -61,16 +63,17 @@ jobs:
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_MESSAGE: ":traffic_cone: Elastic Agent version update failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

# if a PR was created as a result of this job, we notify on the Slack channel
- if: ${{ startsWith(steps.update.outputs.pr, 'https') }}
uses: slackapi/slack-github-action@e598089eaef53883a2d9b325e044899548518a03 # v2.0.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
channel-id: '#ingest-notifications'
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"channel": "#ingest-notifications",
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
Expand All @@ -83,5 +86,4 @@ jobs:
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_MESSAGE: "Update for Elastic Agent versions has been created: ${{ steps.update.outputs.pr }}"
7 changes: 4 additions & 3 deletions .github/workflows/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ failure() }}
uses: slackapi/slack-github-action@e598089eaef53883a2d9b325e044899548518a03 # v2.0.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
channel-id: '#ingest-notifications'
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"channel": "#ingest-notifications",
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
Expand All @@ -47,5 +49,4 @@ jobs:
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>"
7 changes: 4 additions & 3 deletions .github/workflows/updatecli-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ failure() }}
uses: slackapi/slack-github-action@e598089eaef53883a2d9b325e044899548518a03 # v2.0.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
channel-id: '#ingest-notifications'
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"channel": "#ingest-notifications",
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
Expand All @@ -55,5 +57,4 @@ jobs:
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>"

0 comments on commit 634f029

Please sign in to comment.