-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
85 changed files
with
2,231 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
'CI failed': '**/*.*' | ||
'CI failed': '**/*.*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Check for broken Markdown links | ||
|
||
on: | ||
schedule: | ||
- cron: 0 0 * * * | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
check-links: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19.x | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Run link check | ||
run: yarn check-links |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,49 @@ name: Pull Request check | |
on: | ||
pull_request: | ||
types: | ||
- edited | ||
- opened | ||
- synchronize | ||
paths: | ||
- src/**/*.* | ||
jobs: | ||
say-hi: | ||
continue-on-error: true | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for existence of comment | ||
id: comment | ||
run: | | ||
yarn init --yes | ||
yarn add --optional @octokit/[email protected] | ||
node --eval=" | ||
(async function() { | ||
const { Octokit } = require('@octokit/rest'); | ||
const github = new Octokit({ auth: process.env.GITHUB_TOKEN }); | ||
const issueNumber = '${{ github.event.pull_request.number }}'; | ||
const owner = '${{ github.repository_owner }}'; | ||
const repo = '${{ github.repository }}'.replace(owner + '/', ''); | ||
const { data: comments } = await github.issues.listComments({ | ||
owner, | ||
repo, | ||
issue_number: issueNumber, | ||
}); | ||
console.log(comments.some(comment => comment.body.includes('Hi, ${{ github.actor }}'))); | ||
})(); | ||
" >> hi.txt | ||
echo "result=$(cat hi.txt | grep -E 'true|false')" >> $GITHUB_OUTPUT | ||
- name: Say hi | ||
uses: jungwinter/comment@v1 | ||
if: steps.comment.outputs.result == 'false' | ||
with: | ||
type: create | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue_number: ${{ github.event.pull_request.number }} | ||
body: | | ||
Hi, ${{ github.actor }}! | ||
Make sure to comply with the [Code of Conduct](https://github.com/${{ github.repository }}/blob/main/CODE_OF_CONDUCT.md), [security policy](https://github.com/${{ github.repository }}/blob/main/SECURITY.md) and [contribution guidelines](https://github.com/${{ github.repository }}/blob/main/CONTRIBUTING.md) before contributing to this repo. | ||
test: | ||
permissions: | ||
pull-requests: write | ||
|
@@ -23,25 +60,80 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Clone the main repo | ||
run: cd .. && sudo /usr/bin/git clone https://github.com/${{ github.repository }} main && cd - | ||
- name: Check if the PR is acceptable | ||
run: | | ||
diff -q ./tests/ ../main/tests | ||
diff -q ./.github/ ../main/.github | ||
- name: Copy test suites from main repo to PR | ||
run: cp ../main/tests/*.* tests/ | ||
- name: Get rid of the main repo's clone | ||
run: sudo rm -rf ../main | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Validate package.json | ||
run: yarn validate-package-json | ||
|
||
- name: Validate Markdown links | ||
run: yarn check-links | ||
|
||
- name: Run ESLint | ||
run: yarn lint | ||
|
||
- name: Build code | ||
run: yarn build | ||
|
||
- name: Run main test suites | ||
run: yarn test | ||
|
||
- name: Checkout main | ||
run: git clone https://github.com/${{ github.repository }} main/ | ||
- name: Report build failed (if any) | ||
if: failure() | ||
uses: ./.github/workflows/pr-build-failed.yml | ||
uses: ./main/.github/workflows/pr-build-failed.yml | ||
with: | ||
pr-author: ${{ github.event.pull_request.user.login }} | ||
number: ${{ github.event.pull_request.number }} | ||
assign-and-ping: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
needs: test | ||
if: success() | ||
permissions: | ||
pull-requests: write | ||
issues: write | ||
steps: | ||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19.x | ||
|
||
- name: Assign pull request to yourself | ||
run: | | ||
yarn init --yes | ||
yarn add --optional @octokit/[email protected] | ||
node --eval=" | ||
const { Octokit } = require('@octokit/rest'); | ||
const github = new Octokit({ auth: process.env.GITHUB_TOKEN }); | ||
(async function() { | ||
await github.issues.addAssignees({ | ||
owner: '${{ github.repository_owner }}', | ||
repo: '${{ github.repository }}'.replace('${{ github.repository_owner }}/', ''), | ||
issue_number: ${{ github.event.pull_request.number }}, | ||
assignees: ['${{ github.repository_owner }}'], | ||
}); | ||
})(); | ||
" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Request code review | ||
run: | | ||
yarn init --yes | ||
yarn add --optional @octokit/[email protected] | ||
node --eval=" | ||
const { Octokit } = require('@octokit/rest'); | ||
const github = new Octokit({ auth: process.env.GITHUB_TOKEN }); | ||
(async function() { | ||
await github.pulls.requestReviewers({ | ||
owner: '${{ github.repository_owner }}', | ||
repo: '${{ github.repository }}'.replace('${{ github.repository_owner }}/', ''), | ||
pull_number: ${{ github.event.pull_request.number }}, | ||
reviewers: ['${{ github.repository_owner }}'], | ||
}); | ||
})(); | ||
" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"MD010": false, | ||
"MD013": false, | ||
"MD033": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"plugins": [ | ||
"gfm", | ||
"validate-links" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,6 @@ | |
|
||
- Fixed a major bug introduced on the previous version. | ||
|
||
## Version 1.1.7 | ||
|
||
- Added `randomPhone`. |
Oops, something went wrong.