Skip to content

Commit 7bff9bc

Browse files
committed
feat: add personalized comment response for newly opened issues in GitHub Actions workflow
- Implemented a new step to comment as the repository owner on newly opened issues, providing a personal touch in responses. - Added a check for the presence of a personal access token to ensure secure commenting.
1 parent 0f6de06 commit 7bff9bc

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/04-events.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,18 @@ jobs:
2626
ISSUE_NUMBER: ${{ github.event.issue.number }}
2727
GITHUB_REPOSITORY: ${{ github.repository }}
2828
run:
29-
gh issue comment "$ISSUE_NUMBER" --body "Gracias por tu aporte. Nos pondremos en contacto contigo lo antes posible." --repo "$GITHUB_REPOSITORY"
29+
gh issue comment "$ISSUE_NUMBER" --body "Gracias por tu aporte. Nos pondremos en contacto contigo lo antes posible." --repo "$GITHUB_REPOSITORY"
30+
31+
- name: Comentar como autor del repositorio
32+
if: github.event_name == 'issues' && github.event.action == 'opened'
33+
env:
34+
AUTHOR_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
35+
ISSUE_NUMBER: ${{ github.event.issue.number }}
36+
run: |
37+
if [[ -z "$AUTHOR_TOKEN" ]]; then
38+
echo "::warning::No hay PERSONAL_ACCESS_TOKEN configurado. Se omite el comentario como autor."
39+
exit 0
40+
fi
41+
GH_TOKEN="$AUTHOR_TOKEN" gh issue comment "$ISSUE_NUMBER" \
42+
--repo "$GITHUB_REPOSITORY" \
43+
--body "Hola, soy el dueño del repositorio respondiendo personalmente. Mírate la guía de contribución mientras tanto."

0 commit comments

Comments
 (0)