Skip to content

Commit

Permalink
Enhancement : Merge both greet-on-first-pr and merge in pull-request-…
Browse files Browse the repository at this point in the history
…target-yml (#695)

* Added pull-request-yml

* removed greet on first merge and welcome first time contributor

* Removed Issue-labeler-yml
  • Loading branch information
aialok authored May 21, 2024
1 parent d3cd636 commit 3748a1a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 80 deletions.
2 changes: 0 additions & 2 deletions .github/issue-labeler.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/greet_on_first_merge.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/issue-labeler.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/pull-request-target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Pull Request Target Workflow

on:
pull_request_target:
types: [opened, closed]


jobs:
greet-on-first-pr:
runs-on: ubuntu-latest
if: github.event.action == 'opened'
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: >
Welcome to the [JSON Schema](https://json-schema.org/) Community. Thanks a lot for creating your first pull request!! 🎉🎉 We are so excited you are here! We hope this is only the first of many!
For more details check out [README.md](https://github.com/json-schema-org/website?tab=readme-ov-file#-welcome-to-the-json-schema-website) file.
greet-on-first-merge:
runs-on: ubuntu-latest
if: github.event.action == 'closed'
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prNumber = context.payload.pull_request.number;
const authorLogin = context.payload.pull_request.user.login;
const firstPR = await github.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
pull_requests: {
state: 'closed',
author: authorLogin,
},
});
if (firstPR.data.length === 1) {
const greetingMessage = ` Congratulations, @${authorLogin} for your first pull request merge in this repository! 🎉🎉. Thanks for your contribution to JSON Schema! `;
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: greetingMessage
});
}
22 changes: 0 additions & 22 deletions .github/workflows/welcome-first-time-contrib.yml

This file was deleted.

0 comments on commit 3748a1a

Please sign in to comment.