diff --git a/.github/workflows/notify-slack-end.yml b/.github/workflows/notify-slack-end.yml index c72f60c..f472cfa 100644 --- a/.github/workflows/notify-slack-end.yml +++ b/.github/workflows/notify-slack-end.yml @@ -2,6 +2,9 @@ name: Release on: workflow_call: inputs: + message: + required: false + type: string channel: required: true type: string @@ -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>)" } }, { diff --git a/.github/workflows/notify-slack-start.yml b/.github/workflows/notify-slack-start.yml index 82c8a78..6bf4aae 100644 --- a/.github/workflows/notify-slack-start.yml +++ b/.github/workflows/notify-slack-start.yml @@ -2,6 +2,9 @@ name: Release on: workflow_call: inputs: + message: + required: false + type: string channel: required: true type: string @@ -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>)" } }, { diff --git a/README.md b/README.md index 1f3d7fe..ea7569b 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ```