diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml deleted file mode 100644 index e2e2a7442..000000000 --- a/.github/issue-labeler.yml +++ /dev/null @@ -1,2 +0,0 @@ -'Status: Triage': - - '/.*/' diff --git a/.github/workflows/greet_on_first_merge.yml b/.github/workflows/greet_on_first_merge.yml deleted file mode 100644 index 8864f35cc..000000000 --- a/.github/workflows/greet_on_first_merge.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Greet on User First PR Merge - -on: - pull_request: - types: [closed] - -jobs: - greet: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v4 - 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, - }, - }); - - console.log(firstPR.data.length); - - 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 - }); - } diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml deleted file mode 100644 index 96e461912..000000000 --- a/.github/workflows/issue-labeler.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Issue Labeler -on: - issues: - types: [opened] - -permissions: - issues: write - contents: read - -jobs: - triage: - runs-on: ubuntu-latest - steps: - - uses: github/issue-labeler@v3.4 - with: - configuration-path: .github/issue-labeler.yml - enable-versioned-regex: 0 - repo-token: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/pull-request-target.yml b/.github/workflows/pull-request-target.yml new file mode 100644 index 000000000..28fb26752 --- /dev/null +++ b/.github/workflows/pull-request-target.yml @@ -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 + }); + } \ No newline at end of file diff --git a/.github/workflows/welcome-first-time-contrib.yml b/.github/workflows/welcome-first-time-contrib.yml deleted file mode 100644 index 1339a4a1d..000000000 --- a/.github/workflows/welcome-first-time-contrib.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Greeting the new contributor - -on: - pull_request_target: - types: [opened] - issues: - types: [opened] - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: > - Welcome to the [JSON Schema](https://json-schema.org/) Community. We are so excited you are here! Thanks a lot for reporting your first issue!! 🎉🎉 Please make sure to take a look to our [contributors guide](https://github.com/json-schema-org/website/blob/main/CONTRIBUTING.md) if you plan on opening a pull request. - 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. - - 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. \ No newline at end of file