Files
example-back/.github/workflows/auto-comment.yml
2025-01-06 22:36:28 +09:00

34 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Auto Comment on PRs and Issues
on:
issues:
types: [opened]
pull_request:
types: [opened]
jobs:
auto-comment:
runs-on: ubuntu-latest
steps:
- name: Comment on Issue or PR
uses: actions/github-script@v6
with:
script: |
const message = `
Hi @${context.payload.sender.login} 👋
Thank you for ${context.eventName === 'issues' ? 'opening this issue!' : 'submitting this pull request!'} 🚀
${context.eventName === 'issues'
? 'Ive noted it and will review it soon. Please include steps to reproduce, screenshots, or additional context if applicable.'
: 'Your PR has been received and Ill review it as soon as possible. Ensure your code follows the contribution guidelines and that tests are updated if necessary.'}
I really appreciate your effort to improve this project! 🙌
`;
github.rest.issues.createComment({
issue_number: context.payload[context.eventName === 'issues' ? 'issue' : 'pull_request'].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message,
});