Skip to content

Commit

Permalink
Merge branch 'main' into feature/test-message
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/test-slack.yml
  • Loading branch information
wimvdputten committed Jul 15, 2024
2 parents c4e8c28 + 31fb3a5 commit 1e1292b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/notify-slack-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Release
on:
workflow_call:
inputs:
message:
required: false
type: string
channel:
required: true
type: string
Expand Down Expand Up @@ -47,7 +50,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.event.repository.name }} - Action - ${{ github.workflow }}* \n <${{ github.event.repository.url }}/commit/${{ github.sha }} | ${{ env.cut_sha }}> (<${{ github.event.repository.url }}/actions/runs/${{ github.run_id }} | open>)"
"text": "*${{ inputs.message && inputs.message || github.event.repository.name }} - ${{ github.workflow }}* \n <${{ github.event.repository.url }}/commit/${{ github.sha }} | ${{ env.cut_sha }}> (<${{ github.event.repository.url }}/actions/runs/${{ github.run_id }} | open>)"
}
},
{
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/notify-slack-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Release
on:
workflow_call:
inputs:
message:
required: false
type: string
channel:
required: true
type: string
Expand Down Expand Up @@ -45,7 +48,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.event.repository.name }} - Action - ${{ github.workflow }}* 🚀 \n <${{ github.event.repository.url }}/commit/${{ github.sha }} | ${{ env.cut_sha }}> (<${{ github.event.repository.url }}/actions/runs/${{ github.run_id }} | open>)"
"text": "*${{ inputs.message && inputs.message || github.event.repository.name }} - ${{ github.workflow }}* 🚀 \n <${{ github.event.repository.url }}/commit/${{ github.sha }} | ${{ env.cut_sha }}> (<${{ github.event.repository.url }}/actions/runs/${{ github.run_id }} | open>)"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
notify-end:
if: always()
name: Notify release end
needs: [ notify-start, release ]
needs: [ notify-start, activate-pm2 ]
uses: ho-nl/release-slack-action/.github/workflows/notify-slack-end.yml@main
secrets:
slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN}}
with:
time: ${{ needs.notify-start.outputs.time }}
result: ${{ needs.release.result }}
result: ${{ needs.activate-pm2.result }}
channel: 12gobiking-test
message: Test
notifyOnlyOnFailure: false
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
secrets:
slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN}}
with:
message: CUSTOM_MESSAGE (optional if no message is provided, the repository name will be used)
channel: YOUR_CHANNEL_TO_POST_MESSAGES
notifyOnlyOnFailure: boolean

Expand All @@ -39,6 +40,7 @@ jobs:
with:
time: ${{ needs.notify-start.outputs.time }}
result: ${{ needs.release.result }}
message: CUSTOM_MESSAGE (optional if no message is provided, the repository name will be used)
channel: YOUR_CHANNEL_TO_POST_MESSAGES
notifyOnlyOnFailure: boolean
```
Expand Down

0 comments on commit 1e1292b

Please sign in to comment.