[WIP] Set up Copilot instructions for the repository #83
This file contains hidden or 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
| name: Notificación a Microsoft Teams | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| notify_teams: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step to check out the repository to use Git commands | |
| - name: Checkout del repositorio | |
| uses: actions/checkout@v3 | |
| - name: Enviar notificación a Microsoft Teams | |
| env: | |
| TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }} | |
| run: | | |
| EVENT_NAME="${{ github.event_name }}" | |
| ACTOR="${{ github.actor }}" | |
| REPO="${{ github.repository }}" | |
| # Extract the branch name from the ref | |
| BRANCH="${GITHUB_REF##*/}" | |
| COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s') | |
| if [ "$EVENT_NAME" == "push" ]; then | |
| MESSAGE="🚀 Nuevo push en la rama ${BRANCH} del repositorio ${REPO} por ${ACTOR}: ${COMMIT_MESSAGE}" | |
| elif [ "$EVENT_NAME" == "pull_request" ]; then | |
| PR_ACTION="${{ github.event.action }}" | |
| PR_TITLE="${{ github.event.pull_request.title }}" | |
| MESSAGE="📌 Pull request ${PR_ACTION} en la rama ${BRANCH} del repositorio ${REPO} por ${ACTOR}: ${PR_TITLE}" | |
| fi | |
| curl -H "Content-Type: application/json" -d "{ | |
| \"title\": \"Notificación de GitHub\", | |
| \"text\": \"${MESSAGE}\" | |
| }" "$TEAMS_WEBHOOK_URL" |