Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: notificacion dc #1369

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/motify-discord-aproved.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Notify Discord on Pull Request

on:
pull_request:
types: [opened, labeled]

jobs:
notify-discord:
if: ${{ contains(github.event.pull_request.labels.*.name, 'qa-ready') }}
runs-on: ubuntu-latest

steps:
- name: Send notification to Discord
env:
DISCORD_QA_APPROVED: ${{ secrets.DISCORD_QA_APPROVED }}
run: |
MENTION="<@1156585123978940486>"
PR_URL="${{ github.event.pull_request.html_url }}"
PAYLOAD="{\"content\": \"Pull request aprobado: ${PR_URL}\nMencionado: ${MENTION}\"}"
curl -H \"Content-Type: application/json\" -d \"$PAYLOAD\" $DISCORD_QA_APPROVED
19 changes: 19 additions & 0 deletions .github/workflows/motify-discord-needsqaurgent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Notify Discord on Pull Request

on:
pull_request:
types: [opened, labeled]

jobs:
notify-discord:
if: ${{ contains(github.event.pull_request.labels.*.name, 'needs-qa-urgent') }}
runs-on: ubuntu-latest

steps:
- name: Send notification to Discord
env:
DISCORD_QA_FRONT: ${{ secrets.DISCORD_QA_FRONT }}
run: |
MENTION="<@481837609199599636>"
PAYLOAD=$(jq -n --arg url "${{ github.event.pull_request.html_url }}" --arg mention "$MENTION" '{"content": "🚨 **Nuevo pull request que necesita QA URGENTE** 🚨:\n\($url)\n📢 Mencionado: \($mention)"}')
curl -H "Content-Type: application/json" -d "$PAYLOAD" $DISCORD_QA_FRONT
19 changes: 19 additions & 0 deletions .github/workflows/notify-discord-needsqa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Notify Discord on Pull Request

on:
pull_request:
types: [opened]

jobs:
notify-discord:
if: ${{ contains(github.event.pull_request.labels.*.name, 'needs-qa') }}
runs-on: ubuntu-latest

steps:
- name: Send notification to Discord
env:
DISCORD_QA_FRONT: ${{ secrets.DISCORD_QA_FRONT }}
run: |
MENTION="<@481837609199599636>"
PAYLOAD=$(jq -n --arg url "${{ github.event.pull_request.html_url }}" --arg mention "$MENTION" '{"content": "Nuevo pull request que necesita QA: \($url)\nMencionado: \($mention)"}')
curl -H "Content-Type: application/json" -d "$PAYLOAD" $DISCORD_QA_FRONT
31 changes: 31 additions & 0 deletions .github/workflows/notify-discord-on-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Notify Discord on Merge to Production

on:
pull_request:
types: [closed]
branches:
- production

jobs:
notify-discord:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Send notification to Discord
env:
DISCORD_MERGE: ${{ secrets.DISCORD_MERGE }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
COMMIT_URL="https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
MENTION="<@690191607307567119>"
curl -H "Content-Type: application/json" \
-d "{\"content\": \"Se ha hecho merge a la rama production en el repositorio ${GITHUB_REPOSITORY}:\nPull Request: ${PR_URL}\nTítulo: ${PR_TITLE}\nCommit: [${GITHUB_SHA}](${COMMIT_URL})\nAutor: ${{ github.actor }}\nMencionado: ${MENTION}\"}" \
$DISCORD_MERGE
Loading