Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement : Merge both greet-on-first-pr and merge in pull-request-target-yml #695

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading