Skip to content

Feat: Table of content component design change #8

Feat: Table of content component design change

Feat: Table of content component design change #8

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
});
}