Skip to content

Commit

Permalink
Create welcome_new_contributors.yml (#203)
Browse files Browse the repository at this point in the history
Configured workflow to greet new contributors upon creating a new issue or PR.
  • Loading branch information
kyleecodes committed Oct 11, 2023
1 parent 5a258ca commit 7bef657
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/welcome_new_contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Welcome New Contributors

on:
issues:
types: [opened]
pull_request_target:
types: [opened]

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- name: Welcome Issue
if: github.event_name == 'issues'
uses: actions/github-script@v5
with:
script: |
const issue = context.issue;
const repo = context.repo;
const issueAuthor = context.payload.sender.login;
const welcomeMessage = `
Hi @${issueAuthor}! :wave:
Thank you for opening an issue for Chayn! We appreciate your contribution and will get back to you as soon as possible. Please read the CONTRIBUTING.md file to learn more about contributing to Chayn. Happy coding!
`;
github.rest.issues.createComment({
...repo,
issue_number: issue.number,
body: welcomeMessage
});
- name: Welcome Pull Request
if: github.event_name == 'pull_request_target'
uses: actions/github-script@v5
with:
script: |
const pr = context.issue;
const repo = context.repo;
const prAuthor = context.payload.sender.login;
const welcomeMessage = `
Hi @${prAuthor}! :wave:
Thank you for submitting a pull request for Chayn! We appreciate your contribution and will review your changes as soon as possible. Please read the CONTRIBUTING.md file to learn more about contributing to Chayn. Happy coding!
`;
github.rest.issues.createComment({
...repo,
issue_number: pr.number,
body: welcomeMessage
});

0 comments on commit 7bef657

Please sign in to comment.