Skip to content

test : add unit tests for goals-sync-utils repository extraction #2567

test : add unit tests for goals-sync-utils repository extraction

test : add unit tests for goals-sync-utils repository extraction #2567

Workflow file for this run

name: Welcome first-time contributors
permissions:
pull-requests: write
issues: write
on:
pull_request_target:
types: [opened]
issues:
types: [opened]
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: items } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
creator: context.actor,
state: "all",
per_page: 2
});
const priorItems = items.filter(function (i) { return i.number !== context.issue.number; });
if (priorItems.length !== 0) return;
const isPullRequest = !!context.payload.pull_request;
const issueBody = [
"Thanks for opening your first issue on DevTrack! 🎉",
"",
"A maintainer will take a look shortly. In the meantime:",
"- Check the [Contributing guide](https://github.com/Priyanshu-byte-coder/devtrack/blob/main/CONTRIBUTING.md) if you are planning to work on this",
"- Browse [Discussions](https://github.com/Priyanshu-byte-coder/devtrack/discussions) for Q&A and ideas",
"- Look for [`good first issue`](https://github.com/Priyanshu-byte-coder/devtrack/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) if you want somewhere to start",
"",
"If you find DevTrack useful, a ⭐ [star on the repo](https://github.com/Priyanshu-byte-coder/devtrack) is always appreciated — it helps the project reach more developers!"
].join("\n");
const prBody = [
"Thanks for your first PR on DevTrack! 🎉",
"",
"A maintainer will review it within 48 hours. While you wait:",
"- Make sure CI is passing (type-check + lint)",
"- Double-check the PR description is filled out and the issue is linked",
"- Feel free to ask questions in [Discussions](https://github.com/Priyanshu-byte-coder/devtrack/discussions/categories/q-a) if you need help",
"",
"If you find DevTrack useful, a ⭐ [star on the repo](https://github.com/Priyanshu-byte-coder/devtrack) is always appreciated — it helps the project grow and attract more contributors!"
].join("\n");
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: isPullRequest ? prBody : issueBody
});