-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(Root): add ship, show, ask workflows for notifications
- Loading branch information
Showing
2 changed files
with
90 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,40 @@ | ||
name: Notify on Slack about a Pull Request as a Show or Ask type of change | ||
|
||
on: | ||
pull_request: | ||
types: [labeled] | ||
|
||
env: | ||
SLACK_CHANNEL_ID: C018Q6WBJ85 | ||
|
||
jobs: | ||
notify: | ||
if: ${{ github.event.label.name == 'show' || github.event.label.name == 'ask' }} | ||
runs-on: small | ||
steps: | ||
- name: Notify | ||
uses: slackapi/slack-github-action@v1 | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
with: | ||
channel-id: ${{ env.SLACK_CHANNEL_ID }} | ||
payload: | | ||
{ | ||
"text": ":sui: :${{ github.event.label.name }}: _*${{ github.event.pull_request.title }}*_", | ||
"attachments": [ | ||
{ | ||
"color": "${{ github.event.label.name == 'show' && '#AFE1AF' || '#C9CC3F'}} ", | ||
"blocks": [ | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": ":point_right: ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }}\n :github: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
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,50 @@ | ||
name: Notify on Slack about a push to master as a Ship type of change | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
env: | ||
SLACK_CHANNEL_ID: C018Q6WBJ85 | ||
|
||
jobs: | ||
notify: | ||
if: ${{ github.actor != 'srv-scms-git-enb' }} | ||
runs-on: small | ||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.sha }} | ||
- name: Get Head Commit Message | ||
id: get_head_commit_message | ||
run: | | ||
echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_ENV" | ||
- name: Notify | ||
if: ${{ contains(env.HEAD_COMMIT_MESSAGE, 'Merge pull request') == false && contains(env.HEAD_COMMIT_MESSAGE, 'skip notify') == false }} | ||
uses: slackapi/slack-github-action@v1 | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
with: | ||
channel-id: ${{ env.SLACK_CHANNEL_ID }} | ||
payload: | | ||
{ | ||
"text": ":sui: :ship: _*${{ env.HEAD_COMMIT_MESSAGE }}*_", | ||
"attachments": [ | ||
{ | ||
"color": "#AFE1AF", | ||
"blocks": [ | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": ":point_right: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}\n :github: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |