mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-20 02:17:34 +00:00
Merge branch 'main' into mikanto-is-a-dev
This commit is contained in:
31 files changed
+515
-56
No files matched your search
@@ -7,19 +7,23 @@ FAILURE TO COMPLETE ALL REQUIREMENTS WILL RESULT IN A DENIAL OF YOUR PR!
|
|||||||
<!-- Your domain MUST pass ALL the requirements below, otherwise it WILL BE DENIED. -->
|
<!-- Your domain MUST pass ALL the requirements below, otherwise it WILL BE DENIED. -->
|
||||||
<!-- Change each checkbox to [x] (all lowercase, with no spaces between the brackets) to mark it as completed. -->
|
<!-- Change each checkbox to [x] (all lowercase, with no spaces between the brackets) to mark it as completed. -->
|
||||||
|
|
||||||
- [ ] I **agree** to the [Terms of Service](https://is-a.dev/terms). <!-- Your request MUST follow the TOS to be approved. -->
|
- [ ] <!-- TOS --> I **agree** to the [Terms of Service](https://is-a.dev/terms). <!-- Your request MUST follow the TOS to be approved. -->
|
||||||
- [ ] My file is following the [domain structure](https://docs.is-a.dev/domain-structure/). <!-- Your file is in the domains directory, the name is valid, it is JSON format, etc. -->
|
- [ ] <!-- DOMAIN_STRUCTURE --> My file is following the [domain structure](https://docs.is-a.dev/domain-structure/). <!-- Your file is in the domains directory, the name is valid, it is JSON format, etc. -->
|
||||||
- [ ] My website is **reachable** and **completed**. <!-- We do not permit simple "Hello, world!" or simply copied template websites with minimal changes. -->
|
- [ ] <!-- WEBSITE_REACHABLE --> My website is **reachable** and **completed**. <!-- We do not permit simple "Hello, world!" or simply copied template websites with minimal changes. -->
|
||||||
- [ ] My website is **software development** related. <!-- We do not accept websites such as gaming, courses, AI agents/chatbots, etc. NOTE: Only your root subdomain needs to meet this requirement. -->
|
- [ ] <!-- SOFTWARE_RELATED --> My website is **software development** related. <!-- We do not accept websites such as gaming, courses, AI agents/chatbots, etc. NOTE: Only your root subdomain needs to meet this requirement. -->
|
||||||
- [ ] My website is **not for commercial use**. <!-- Your website's purpose should not be to generate any form of revenue or profit. (e.g. a business) -->
|
- [ ] <!-- NON_COMMERCIAL --> My website is **not for commercial use**. <!-- Your website's purpose should not be to generate any form of revenue or profit. (e.g. a business) -->
|
||||||
- [ ] I have provided sufficient contact information in the `owner` key. <!-- Provide your email in the `email` field or another platform (e.g. Twitter or Discord) for contact. -->
|
- [ ] <!-- CONTACT_INFO --> I have provided sufficient contact information in the `owner` key. <!-- Provide your email in the `email` field or another platform (e.g. Twitter or Discord) for contact. -->
|
||||||
- [ ] I have provided a link to my website below. <!-- This step is required for your PR to be approved. -->
|
- [ ] <!-- WEBSITE_LINK --> I have provided a link to my website below. <!-- This step is required for your PR to be approved. -->
|
||||||
|
|
||||||
# Website Preview
|
# Website Preview
|
||||||
<!-- Provide a LINK of your website below. We do NOT accept screenshots, with the exception we ask you for one. -->
|
<!-- Provide a LINK to your website below. We do NOT accept screenshots. -->
|
||||||
<!-- This should be a LINK to the existing domain your website is on, NOT the is-a.dev domain you're applying for. (e.g. https://abc.vercel.app, https://abc.github.io) -->
|
<!-- This should be a LINK to the existing domain your website is on, NOT the is-a.dev domain you're applying for. (e.g. https://abc.vercel.app, https://abc.github.io) -->
|
||||||
<!-- WE ASK FOR LINKS NOT JUST HOSTNAMES AS THIS MAKES OUR LIVES EASIER -->
|
|
||||||
<!-- SCREENSHOTS ARE NOT PERMITTED AS PREVIEWS. -->
|
<!-- WEBSITE_PREVIEW_START -->
|
||||||
|
<!-- WEBSITE_PREVIEW_END -->
|
||||||
|
|
||||||
# Website Purpose
|
# Website Purpose
|
||||||
<!-- Please tell us the purpose or motive behind your website. For example, it is a portfolio website, etc. -->
|
<!-- Please tell us the purpose or motive behind your website. For example, it is a portfolio website, etc. -->
|
||||||
|
|
||||||
|
<!-- WEBSITE_PURPOSE_START -->
|
||||||
|
<!-- WEBSITE_PURPOSE_END -->
|
||||||
@@ -29,20 +29,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Fetch PR information
|
- name: Fetch PR information
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
run: |
|
|
||||||
echo "PR_AUTHOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
|
|
||||||
echo "PR_AUTHOR_ID=${{ github.event.pull_request.user.id }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
LABELS=$(gh api --jq '[.labels[].name]' /repos/{owner}/{repo}/pulls/${{ github.event.number }})
|
|
||||||
echo "PR_LABELS=$LABELS" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
FILES=$(gh api --jq '[.[] | select(.status != "removed") | .filename]' /repos/{owner}/{repo}/pulls/${{ github.event.number }}/files)
|
|
||||||
echo "CHANGED_FILES=$FILES" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
REMOVED_FILE_DATA=$(gh api --jq '[.[] | select(.status == "removed") | {name: .filename, data: .patch}]' /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files)
|
|
||||||
echo "DELETED_FILES=$REMOVED_FILE_DATA" >> $GITHUB_ENV
|
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
PR: ${{ github.event.pull_request.number }}
|
||||||
|
run: |
|
||||||
|
echo "PR_AUTHOR=${{ github.event.pull_request.user.login }}" >> "$GITHUB_ENV"
|
||||||
|
echo "PR_AUTHOR_ID=${{ github.event.pull_request.user.id }}" >> "$GITHUB_ENV"
|
||||||
|
echo "PR_LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '[.labels[].name]')" >> "$GITHUB_ENV"
|
||||||
|
echo "CHANGED_FILES=$(gh api --jq '[.[] | select(.status != "removed") | .filename]' "repos/${{ github.repository }}/pulls/$PR/files")" >> "$GITHUB_ENV"
|
||||||
|
echo "DELETED_FILES=$(gh api --jq '[.[] | select(.status == "removed") | {name: .filename, data: .patch}]' "repos/${{ github.repository }}/pulls/$PR/files")" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- uses: gacts/install-dnscontrol@890ba3249712c51203ccb7aba63307c0091e921b # v1.3.4
|
- uses: gacts/install-dnscontrol@890ba3249712c51203ccb7aba63307c0091e921b # v1.3.4
|
||||||
if: github.event_name == 'pull_request' && contains(fromJson(env.CHANGED_FILES), 'dnsconfig.js')
|
if: github.event_name == 'pull_request' && contains(fromJson(env.CHANGED_FILES), 'dnsconfig.js')
|
||||||
@@ -50,8 +45,8 @@ jobs:
|
|||||||
version: 4.14.0
|
version: 4.14.0
|
||||||
|
|
||||||
- name: Run DNSControl checks
|
- name: Run DNSControl checks
|
||||||
run: dnscontrol check
|
|
||||||
if: github.event_name == 'pull_request' && contains(fromJson(env.CHANGED_FILES), 'dnsconfig.js')
|
if: github.event_name == 'pull_request' && contains(fromJson(env.CHANGED_FILES), 'dnsconfig.js')
|
||||||
|
run: dnscontrol check
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npx ava tests/*.test.js --timeout=1m
|
run: npx ava tests/*.test.js --timeout=1m
|
||||||
@@ -0,0 +1,262 @@
|
|||||||
|
name: PR
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- edited
|
||||||
|
- synchronize
|
||||||
|
- labeled
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
issues: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
label:
|
||||||
|
name: Label
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check changed paths
|
||||||
|
id: changes
|
||||||
|
uses: dorny/paths-filter@v3
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
ci:
|
||||||
|
- ".github/workflows/*"
|
||||||
|
- "tests/*"
|
||||||
|
- "util/*"
|
||||||
|
- "package.json"
|
||||||
|
- "package-lock.json"
|
||||||
|
- "dnsconfig.js"
|
||||||
|
domain:
|
||||||
|
- "domains/*"
|
||||||
|
documentation:
|
||||||
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
||||||
|
- ".github/copilot-instructions.md"
|
||||||
|
- "README.md"
|
||||||
|
r-william:
|
||||||
|
- ".github/CODEOWNERS"
|
||||||
|
- "CODE_OF_CONDUCT.md"
|
||||||
|
- "CONTRIBUTING.md"
|
||||||
|
- "SECURITY.md"
|
||||||
|
- "TERMS_OF_SERVICE.md"
|
||||||
|
- "LICENSE"
|
||||||
|
|
||||||
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.repository.default_branch }}
|
||||||
|
|
||||||
|
- name: Check trusted user
|
||||||
|
id: check-trusted
|
||||||
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
PR_AUTHOR_ID: ${{ github.event.pull_request.user.id }}
|
||||||
|
run: |
|
||||||
|
node - <<'NODE'
|
||||||
|
const trustedUsers = require("./util/trusted.json");
|
||||||
|
|
||||||
|
const authorId = Number(process.env.PR_AUTHOR_ID);
|
||||||
|
|
||||||
|
if (!trustedUsers.some((u) => u.id === authorId)) {
|
||||||
|
console.log("PR author is not a trusted user.");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("PR author is a trusted user.");
|
||||||
|
NODE
|
||||||
|
|
||||||
|
- name: Add labels
|
||||||
|
uses: actions/github-script@v8
|
||||||
|
env:
|
||||||
|
CI_CHANGED: ${{ steps.changes.outputs.ci }}
|
||||||
|
DOCUMENTATION: ${{ steps.changes.outputs.documentation }}
|
||||||
|
DOMAIN_CHANGED: ${{ steps.changes.outputs.domain }}
|
||||||
|
MAINTAINER: ${{ steps.check-trusted.outcome == 'success' }}
|
||||||
|
R_WILLIAM: ${{ steps.changes.outputs.r-william }}
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.BOT }}
|
||||||
|
script: |
|
||||||
|
const labels = [];
|
||||||
|
|
||||||
|
if (process.env.CI_CHANGED === "true") {
|
||||||
|
labels.push("ci");
|
||||||
|
labels.push("r: william");
|
||||||
|
}
|
||||||
|
if (process.env.DOCUMENTATION === "true") labels.push("documentation");
|
||||||
|
if (process.env.DOMAIN_CHANGED === "true") labels.push("domain");
|
||||||
|
if (process.env.MAINTAINER === "true") labels.push("maintainer");
|
||||||
|
if (process.env.R_WILLIAM === "true") labels.push("r: william");
|
||||||
|
|
||||||
|
const uniqueLabels = [...new Set(labels)];
|
||||||
|
|
||||||
|
if (uniqueLabels.length) {
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
labels: uniqueLabels
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
template:
|
||||||
|
name: Template
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.repository.default_branch }}
|
||||||
|
|
||||||
|
- name: Validate PR template
|
||||||
|
id: validate
|
||||||
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
PR_BODY: ${{ github.event.pull_request.body }}
|
||||||
|
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
||||||
|
PR_AUTHOR_ID: ${{ github.event.pull_request.user.id }}
|
||||||
|
PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
|
||||||
|
run: node util/check-pr-template.cjs
|
||||||
|
|
||||||
|
- name: Handle incomplete PR
|
||||||
|
if: steps.validate.outcome == 'failure'
|
||||||
|
uses: actions/github-script@v8
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.BOT }}
|
||||||
|
script: |
|
||||||
|
const label = "reason: incomplete pr";
|
||||||
|
|
||||||
|
try {
|
||||||
|
await github.rest.issues.getLabel({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
name: label
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status === 404) {
|
||||||
|
await github.rest.issues.createLabel({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
name: label,
|
||||||
|
color: "D93F0B",
|
||||||
|
description: "Your PR template is not complete. (e.g. missing the requirements form, missing website preview)"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const labels = await github.rest.issues.listLabelsOnIssue({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!labels.data.some((item) => item.name === label)) {
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
labels: [label]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const marker = "<!-- is-a-dev-bot: incomplete-pr-template -->";
|
||||||
|
|
||||||
|
const comments = await github.paginate(
|
||||||
|
github.rest.issues.listComments,
|
||||||
|
{
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const alreadyCommented = comments.some(
|
||||||
|
(comment) =>
|
||||||
|
comment.user?.login === "is-a-dev-bot" &&
|
||||||
|
comment.body?.includes(marker)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!alreadyCommented) {
|
||||||
|
const body = [
|
||||||
|
marker,
|
||||||
|
"## ❌ Incomplete PR template",
|
||||||
|
"",
|
||||||
|
"This pull request is missing required information from the PR template.",
|
||||||
|
"",
|
||||||
|
"***Your PR will not be approved without the template being properly filled out!***",
|
||||||
|
"",
|
||||||
|
"Please make sure that:",
|
||||||
|
"",
|
||||||
|
"- The PR template has not been modified.",
|
||||||
|
" - *Modifying the PR template will make this check fail.*",
|
||||||
|
"- All requirement checkboxes are checked.",
|
||||||
|
" - *All checkboxes must be changed exactly to `[x]`, NOT something like `[ x ]`.*",
|
||||||
|
"- **Website Preview** is filled out.",
|
||||||
|
" - *Make sure it is filled between the start/end comment markers.*",
|
||||||
|
"- **Website Purpose** is filled out.",
|
||||||
|
" - *Make sure it is filled between the start/end comment markers.*",
|
||||||
|
"---",
|
||||||
|
"Once the template has been properly completed, this check will run again automatically."
|
||||||
|
].join("\n");
|
||||||
|
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
body
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Remove incomplete label and comment
|
||||||
|
if: steps.validate.outcome == 'success'
|
||||||
|
uses: actions/github-script@v8
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.BOT }}
|
||||||
|
script: |
|
||||||
|
const label = "reason: incomplete pr";
|
||||||
|
const marker = "<!-- is-a-dev-bot: incomplete-pr-template -->";
|
||||||
|
|
||||||
|
try {
|
||||||
|
await github.rest.issues.removeLabel({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
name: label
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status !== 404) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const comments = await github.paginate(
|
||||||
|
github.rest.issues.listComments,
|
||||||
|
{
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const comment of comments) {
|
||||||
|
if (
|
||||||
|
comment.user?.login === "is-a-dev-bot" &&
|
||||||
|
comment.body?.includes(marker)
|
||||||
|
) {
|
||||||
|
await github.rest.issues.deleteComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
comment_id: comment.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Fail if PR template is incomplete
|
||||||
|
if: steps.validate.outcome == 'failure'
|
||||||
|
run: |
|
||||||
|
echo "::error::PR template is incomplete."
|
||||||
|
exit 1
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
name: Prettifier
|
name: Prettier
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- ".prettierrc"
|
||||||
|
- ".github/workflows/prettier.yml"
|
||||||
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * 0" # Runs every week on Sunday
|
- cron: "0 0 * * 0" # Runs every week on Sunday
|
||||||
|
|
||||||
@@ -22,14 +28,14 @@ jobs:
|
|||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|
||||||
- name: Run the prettifier and open a PR if it changed something
|
- name: Run Prettier and open PR
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
git config --global user.email "actions@github.com"
|
git config --global user.email "bot@is-a.dev"
|
||||||
git config --global user.name "GitHub Actions"
|
git config --global user.name "is-a-dev-bot"
|
||||||
|
|
||||||
BRANCH="prettify-json-files"
|
BRANCH="prettier-$(date +%s%3N)"
|
||||||
|
|
||||||
git push origin --delete "$BRANCH" 2>/dev/null || true
|
git push origin --delete "$BRANCH" 2>/dev/null || true
|
||||||
|
|
||||||
@@ -43,9 +49,9 @@ jobs:
|
|||||||
|
|
||||||
git add .
|
git add .
|
||||||
COUNT=$(git status -s -uno | wc -l)
|
COUNT=$(git status -s -uno | wc -l)
|
||||||
git commit -m "chore(domains): prettify all json files"
|
git commit -m "chore(domains): prettier"
|
||||||
git push --set-upstream origin "$BRANCH"
|
git push --set-upstream origin "$BRANCH"
|
||||||
|
|
||||||
gh pr create -l maintainer -t "chore(domains): prettify all json files" -b "$COUNT file(s) have been modified."
|
gh pr create -l maintainer -t "chore(domains): prettier" -b "$COUNT file(s) have been prettified."
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ secrets.BOT }}
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
source-directory: "raw-api"
|
source-directory: "raw-api"
|
||||||
destination-github-username: is-a-dev
|
destination-github-username: is-a-dev
|
||||||
destination-repository-name: raw-api
|
destination-repository-name: raw-api
|
||||||
user-email: "actions@github.com"
|
user-email: "bot@is-a.dev"
|
||||||
user-name: "GitHub Actions"
|
user-name: "is-a-dev-bot"
|
||||||
env:
|
env:
|
||||||
API_TOKEN_GITHUB: ${{ secrets.BOT }}
|
API_TOKEN_GITHUB: ${{ secrets.BOT }}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
name: Update PR Branches
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
name: Update
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Update branches
|
||||||
|
uses: actions/github-script@v8
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.BOT }}
|
||||||
|
script: |
|
||||||
|
const prs = await github.paginate(
|
||||||
|
github.rest.pulls.list,
|
||||||
|
{
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: "open",
|
||||||
|
per_page: 100
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(`Found ${prs.length} open PRs`);
|
||||||
|
|
||||||
|
for (const pr of prs) {
|
||||||
|
try {
|
||||||
|
await github.rest.pulls.updateBranch({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
pull_number: pr.number
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Updated #${pr.number} (${pr.head.ref})`);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(`Could not update #${pr.number}: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"parser": "json",
|
"parser": "json",
|
||||||
"printWidth": 1,
|
"printWidth": 1,
|
||||||
"tabWidth": 4
|
"tabWidth": 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
"email": "jiangwilliam30@gmail.com"
|
"email": "jiangwilliam30@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["216.198.79.1"]
|
"A": [
|
||||||
|
"216.198.79.1"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"owner": {
|
||||||
|
"username": "OMEGA-5656",
|
||||||
|
"email": "abhisheksaini5656000@gmail.com"
|
||||||
|
},
|
||||||
|
"records": {
|
||||||
|
"TXT": "vc-domain-verify=abhishek-saini.is-a.dev,e05233064af3a98c4ed2"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"owner": {
|
||||||
|
"username": "OMEGA-5656",
|
||||||
|
"email": "abhisheksaini5656000@gmail.com"
|
||||||
|
},
|
||||||
|
"records": {
|
||||||
|
"A": [
|
||||||
|
"216.198.79.1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"email": "afrijalwijatmiko@gmail.com"
|
"email": "afrijalwijatmiko@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["216.198.79.1"]
|
"A": [
|
||||||
|
"216.198.79.1"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"email": "arslanaqazi3@gmail.com"
|
"email": "arslanaqazi3@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["130.210.25.209"]
|
"A": [
|
||||||
|
"130.210.25.209"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,8 @@
|
|||||||
"email": "nourinawad@gmail.com"
|
"email": "nourinawad@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["89.168.117.165"]
|
"A": [
|
||||||
|
"89.168.117.165"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"email": "thiruxd@gmail.com"
|
"email": "thiruxd@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["75.2.60.5"]
|
"A": [
|
||||||
|
"75.2.60.5"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"email": "arthursantossousa05@gmail.com"
|
"email": "arthursantossousa05@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"CNAME": "p3-host.triniumhost.com"
|
"CNAME": "p-host.triniumhost.indevs.in"
|
||||||
},
|
},
|
||||||
"proxied": true
|
"proxied": true
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"email": "arthursantossousa05@gmail.com"
|
"email": "arthursantossousa05@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"CNAME": "kiritoapi-host.triniumhost.com"
|
"CNAME": "p-host.triniumhost.indevs.in"
|
||||||
},
|
},
|
||||||
"proxied": true
|
"proxied": true
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"email": "arthursantossousa05@gmail.com"
|
"email": "arthursantossousa05@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"CNAME": "kiritodb-host.triniumhost.com"
|
"CNAME": "p-host.triniumhost.indevs.in"
|
||||||
},
|
},
|
||||||
"proxied": true
|
"proxied": true
|
||||||
}
|
}
|
||||||
+7
-2
@@ -4,8 +4,13 @@
|
|||||||
"discord": "whatifyousaidyeswouldgo"
|
"discord": "whatifyousaidyeswouldgo"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["75.2.60.5"],
|
"A": [
|
||||||
"MX": ["mx1.improvmx.com", "mx2.improvmx.com"],
|
"75.2.60.5"
|
||||||
|
],
|
||||||
|
"MX": [
|
||||||
|
"mx1.improvmx.com",
|
||||||
|
"mx2.improvmx.com"
|
||||||
|
],
|
||||||
"TXT": [
|
"TXT": [
|
||||||
"brevo-code:a3319400a629436ff8d741c6bfc863a3",
|
"brevo-code:a3319400a629436ff8d741c6bfc863a3",
|
||||||
"v=DMARC1; p=none; rua=mailto:rua@dmarc.brevo.com",
|
"v=DMARC1; p=none; rua=mailto:rua@dmarc.brevo.com",
|
||||||
|
|||||||
@@ -4,7 +4,12 @@
|
|||||||
"email": "anasyusuf12@gmail.com"
|
"email": "anasyusuf12@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"MX": ["mx1.improvmx.com", "mx2.improvmx.com"],
|
"MX": [
|
||||||
"TXT": ["v=spf1 include:spf.improvmx.com ~all"]
|
"mx1.improvmx.com",
|
||||||
|
"mx2.improvmx.com"
|
||||||
|
],
|
||||||
|
"TXT": [
|
||||||
|
"v=spf1 include:spf.improvmx.com ~all"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
"username": "Mandimby2003"
|
"username": "Mandimby2003"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["216.198.79.1"]
|
"A": [
|
||||||
|
"216.198.79.1"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"email": "arthursantossousa05@gmail.com"
|
"email": "arthursantossousa05@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"CNAME": "p3-host.triniumhost.com"
|
"CNAME": "p-host.triniumhost.indevs.in"
|
||||||
},
|
},
|
||||||
"proxied": true
|
"proxied": true
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"email": "dev.mohamed.abdalnabi@gmail.com"
|
"email": "dev.mohamed.abdalnabi@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["216.198.79.1"]
|
"A": [
|
||||||
|
"216.198.79.1"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"email": "arthursantossousa05@gmail.com"
|
"email": "arthursantossousa05@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"CNAME": "p3-host.triniumhost.com"
|
"CNAME": "p-host.triniumhost.indevs.in"
|
||||||
},
|
},
|
||||||
"proxied": true
|
"proxied": true
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"email": "arthursantossousa05@gmail.com"
|
"email": "arthursantossousa05@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"CNAME": "p3-host.triniumhost.com"
|
"CNAME": "p-host.triniumhost.indevs.in"
|
||||||
},
|
},
|
||||||
"proxied": true
|
"proxied": true
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
"email": "arthursantossousa05@gmail.com"
|
"email": "arthursantossousa05@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"CNAME": "p3-host.triniumhost.com"
|
"CNAME": "p-host.triniumhost.indevs.in"
|
||||||
},
|
},
|
||||||
"proxied": true
|
"proxied": true
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"email": "sushovan1908@gmail.com"
|
"email": "sushovan1908@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["216.198.79.1"]
|
"A": [
|
||||||
|
"216.198.79.1"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"email": "abdulwaarisinfo@gmail.com"
|
"email": "abdulwaarisinfo@gmail.com"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["216.24.57.1"]
|
"A": [
|
||||||
|
"216.24.57.1"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-1
@@ -4,6 +4,8 @@
|
|||||||
"username": "zarrar-devs"
|
"username": "zarrar-devs"
|
||||||
},
|
},
|
||||||
"records": {
|
"records": {
|
||||||
"A": ["216.198.79.1"]
|
"A": [
|
||||||
|
"216.198.79.1"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
const trustedUsers = require("./trusted.json");
|
||||||
|
|
||||||
|
const body = process.env.PR_BODY || "";
|
||||||
|
const authorUsername = process.env.PR_AUTHOR || "";
|
||||||
|
const authorId = Number(process.env.PR_AUTHOR_ID);
|
||||||
|
const labels = JSON.parse(process.env.PR_LABELS || "[]");
|
||||||
|
|
||||||
|
const BYPASS_LABELS = ["ci: bypass-template-check", "maintainer"];
|
||||||
|
|
||||||
|
const isTrustedUser = trustedUsers.some((u) => u.id === authorId);
|
||||||
|
const hasBypassLabel = labels.some((l) => BYPASS_LABELS.includes(l));
|
||||||
|
|
||||||
|
if (isTrustedUser) {
|
||||||
|
console.log(`PR author "${authorUsername}" is a trusted user. Skipping template validation.`);
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasBypassLabel) {
|
||||||
|
console.log(`PR has a label which bypasses this check. Skipping template validation.`);
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
const REQUIRED_CHECKBOXES = [
|
||||||
|
"TOS",
|
||||||
|
"DOMAIN_STRUCTURE",
|
||||||
|
"WEBSITE_REACHABLE",
|
||||||
|
"SOFTWARE_RELATED",
|
||||||
|
"NON_COMMERCIAL",
|
||||||
|
"CONTACT_INFO",
|
||||||
|
"WEBSITE_LINK",
|
||||||
|
];
|
||||||
|
|
||||||
|
function isCheckboxChecked(marker) {
|
||||||
|
const regex = new RegExp(
|
||||||
|
`-\\s*\\[[xX]\\]\\s*<!--\\s*${marker}\\s*-->`,
|
||||||
|
"i",
|
||||||
|
);
|
||||||
|
|
||||||
|
return regex.test(body);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSection(startMarker, endMarker) {
|
||||||
|
const regex = new RegExp(
|
||||||
|
`${escapeRegExp(startMarker)}([\\s\\S]*?)${escapeRegExp(endMarker)}`,
|
||||||
|
"i",
|
||||||
|
);
|
||||||
|
|
||||||
|
const match = body.match(regex);
|
||||||
|
|
||||||
|
return match ? match[1].trim() : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function escapeRegExp(value) {
|
||||||
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
|
}
|
||||||
|
|
||||||
|
const errors = [];
|
||||||
|
|
||||||
|
for (const checkbox of REQUIRED_CHECKBOXES) {
|
||||||
|
if (!isCheckboxChecked(checkbox)) {
|
||||||
|
errors.push(
|
||||||
|
`The \`${checkbox}\` requirement has not been checked.`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const websitePreview = getSection(
|
||||||
|
"<!-- WEBSITE_PREVIEW_START -->",
|
||||||
|
"<!-- WEBSITE_PREVIEW_END -->",
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!websitePreview) {
|
||||||
|
errors.push(
|
||||||
|
"The **Website Preview** section has not been filled out.",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const websitePurpose = getSection(
|
||||||
|
"<!-- WEBSITE_PURPOSE_START -->",
|
||||||
|
"<!-- WEBSITE_PURPOSE_END -->",
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!websitePurpose) {
|
||||||
|
errors.push(
|
||||||
|
"The **Website Purpose** section has not been filled out.",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errors.length > 0) {
|
||||||
|
console.error("PR template validation failed.");
|
||||||
|
console.error("");
|
||||||
|
console.error(errors.join("\n"));
|
||||||
|
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("PR template validation passed.");
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
[
|
[
|
||||||
"api.cf-pages",
|
|
||||||
"cf-pages",
|
"cf-pages",
|
||||||
"data",
|
"data",
|
||||||
"docs",
|
"docs",
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
"username": "iostpa",
|
"username": "iostpa",
|
||||||
"id": 69630113
|
"id": 69630113
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"username": "is-a-dev-bot",
|
||||||
|
"id": 106927495,
|
||||||
|
"admin": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"username": "orangci",
|
"username": "orangci",
|
||||||
"id": 90866414
|
"id": 90866414
|
||||||
|
|||||||
Reference in new issue
Block a user