-
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement : Merge both greet-on-first-pr and merge in pull-request-…
…target-yml (#695) * Added pull-request-yml * removed greet on first merge and welcome first time contributor * Removed Issue-labeler-yml
- Loading branch information
Showing
5 changed files
with
49 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
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 | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.