Spaces:
Sleeping
Sleeping
| name: Discord and Teams Notification | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| notify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: SendDiscordNotification | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| run: | | |
| COMMIT_URL="${{ github.event.head_commit.url }}" | |
| COMMIT_MESSAGE="${{ github.event.head_commit.message }}" | |
| curl -X POST -H "Content-Type: application/json" \ | |
| -d "{\"content\": \"@everyone π₯ **A new commit was pushed to the main branch by $GITHUB_ACTOR** π₯\\n**Commit Message:** ${COMMIT_MESSAGE} \\n**Commit URL:** ${COMMIT_URL}\"}" \ | |
| $DISCORD_WEBHOOK_URL | |
| - name: SendTeamsNotification | |
| env: | |
| TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK }} | |
| run: | | |
| COMMIT_URL="${{ github.event.head_commit.url }}" | |
| COMMIT_MESSAGE="${{ github.event.head_commit.message }}" | |
| curl -H 'Content-Type: application/json' \ | |
| -d "{\"@type\": \"MessageCard\", \"@context\": \"http://schema.org/extensions\", \"summary\": \"New commit in GitHub\", \"sections\": [{\"activityTitle\": \"π₯ **A new commit was pushed to the main branch by $GITHUB_ACTOR** π₯\", \"text\": \"**Commit Message:** ${COMMIT_MESSAGE}\\n**Commit URL:** [Click Here](${COMMIT_URL})\"}]}" \ | |
| $TEAMS_WEBHOOK_URL | |