Gracias por tu aporte Midu #14
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: 04 - Events | |
| on: | |
| issues: | |
| types: [opened, reopened] | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| inspect-event: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Inspect event | |
| run: | | |
| echo "Event: ${{ github.event_name }}" | |
| echo "Issue: ${{ github.event.issue.number }}" | |
| echo "Comment: ${{ github.event.comment.body }}" | |
| - name: Comentar como bot en GitHub Actions | |
| if: github.event_name == 'issues' && github.event.action == 'opened' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| run: | |
| gh issue comment "$ISSUE_NUMBER" --body "Gracias por tu aporte. Nos pondremos en contacto contigo lo antes posible." --repo "$GITHUB_REPOSITORY" | |
| - name: Comentar como autor del repositorio | |
| if: github.event_name == 'issues' && github.event.action == 'opened' | |
| env: | |
| AUTHOR_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| run: | | |
| if [[ -z "$AUTHOR_TOKEN" ]]; then | |
| echo "::warning::No hay PERSONAL_ACCESS_TOKEN configurado. Se omite el comentario como autor." | |
| exit 0 | |
| fi | |
| GH_TOKEN="$AUTHOR_TOKEN" gh issue comment "$ISSUE_NUMBER" \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --body "Hola, soy el dueño del repositorio respondiendo personalmente. Mírate la guía de contribución mientras tanto." |