-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77cb279
commit d9a1e43
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Run the slack notification for various things | ||
description: This sends a slack notification | ||
|
||
inputs: | ||
slack_channel: | ||
description: 'The channel to send the slack message to' | ||
required: true | ||
slack_bot_token: | ||
description: 'The slack bot token' | ||
required: true | ||
pull_request_number: | ||
description: The number of the pull request | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Slack - Send a message | ||
id: slack-message | ||
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 | ||
with: | ||
method: chat.postMessage | ||
token: ${{ inputs.slack_bot_token }} | ||
payload: | | ||
"channel": "${{ inputs.slack_channel }}", | ||
"text": "*GITHUB ACTIONS RUNNER*: upgrade PR has been created for *${{ github.event.repository.name }}*", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Github Actions Runner PR - new runner available*" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Pull Request:*\n<${{ github.server_url }}/${{ github.repository }}/pull/${{ inputs.pull_request_number }}/files|${{ github.event.repository.name }}/pull/${{ inputs.pull_request_number }}>" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: New PR created - Slack message if it's a renovate Dockerfile PR | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
|
||
jobs: | ||
renovate_pr: | ||
runs-on: [ ubuntu-latest ] | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Get PR details | ||
id: get_pr_details | ||
run: | | ||
echo "::set-output name=title::$(jq -r .pull_request.title < $GITHUB_EVENT_PATH)" | ||
echo "::set-output name=number::$(jq -r .pull_request.number < $GITHUB_EVENT_PATH)" | ||
- name: Run action if PR title contains 'actions/runner' | ||
if: contains(steps.get_pr_details.outputs.title, 'actions/runner') | ||
uses: ./.github/actions/runner-slack-notification | ||
with: | ||
slack_channel: ${{ vars.NOTIFICATIONS_SLACK_CHANNEL }} | ||
slack_bot_token: ${{ secrets.HMPPS_SRE_SLACK_BOT_TOKEN }} | ||
pull_request_number: ${{ steps.get_pr_details.outputs.number }} |