Skip to content

Commit

Permalink
feat: version 1.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
santi100a committed Aug 12, 2023
1 parent 312f53a commit 2a4a6da
Show file tree
Hide file tree
Showing 85 changed files with 2,231 additions and 443 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ updates:
- package-ecosystem: npm # See documentation for possible values
directory: / # Location of package manifests
schedule:
interval: weekly
interval: daily
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'CI failed': '**/*.*'
'CI failed': '**/*.*'
19 changes: 19 additions & 0 deletions .github/workflows/check-md-links.yml
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
47 changes: 40 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:

jobs:
test:
outputs:
IS_RELEASE_COMMIT: ${{ steps.commit.outputs.IS_RELEASE_COMMIT }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -17,15 +19,48 @@ jobs:
node-version: 19.x
always-auth: true

- name: Check commit message
id: commit
run: |
COMMIT_MSG=$(/usr/bin/git log --format=%B -n 1 HEAD)
STRING=$(echo $COMMIT_MSG | (grep -E "infra:|docs:|lint:|code-style:" || echo ''))
if [ -z "$STRING" ]; then
echo "IS_RELEASE_COMMIT=1" >> $GITHUB_OUTPUT
echo "IS_RELEASE_COMMIT=1" >> $GITHUB_ENV
else
echo "This commit will NOT trigger a release."
echo "IS_RELEASE_COMMIT=0" >> $GITHUB_OUTPUT
echo "IS_RELEASE_COMMIT=0" >> $GITHUB_ENV
fi
- name: Install dependencies
run: yarn
run: yarn

- name: Validate Markdown links
run: yarn check-links

- name: Validate package.json
run: yarn validate-package-json

- name: Run ESLint
if: env.IS_RELEASE_COMMIT == '1'
run: |
yarn lint
- name: Build source code
run: yarn build
if: env.IS_RELEASE_COMMIT == '1'
run: |
yarn build
- name: Run test suites
run: yarn test
if: env.IS_RELEASE_COMMIT == '1'
run: |
yarn test
release:
if: needs.test.outputs.IS_RELEASE_COMMIT == '1'
permissions:
contents: write
needs: test
Expand Down Expand Up @@ -66,8 +101,6 @@ jobs:
run: yarn
- name: Build code
run: yarn build
- name: Build UMD Version
run: yarn build:umd
- name: Set authentication token
run: |
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_AUTH_TOKEN }}
Expand All @@ -90,11 +123,11 @@ jobs:
run: yarn
- name: Build code
run: yarn build
- name: Build UMD Version
run: yarn build:umd

- name: Set authentication token
run: |
npm set //npm.pkg.github.com/:_authToken ${{ secrets.GPR_AUTH_TOKEN }}
- name: Get ready to publish to GPR
run: |
jq ".name = \"@$REPO\"" package.json > temp.json && mv temp.json package.json
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/issue-welcome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue_number: ${{ github.event.issue.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)
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-build-failed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
Don't worry, it'll run again if you commit any changes to this PR.
- name: Label PR as "CI failed"
uses: actions/labeler@v4
with:
with:
sync-label: true
repo-token: ${{ secrets.GITHUB_TOKEN }}

120 changes: 106 additions & 14 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
25 changes: 0 additions & 25 deletions .github/workflows/pr-welcome.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"MD010": false,
"MD013": false,
"MD033": false
}
6 changes: 6 additions & 0 deletions .remarkrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
"gfm",
"validate-links"
]
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@

- Fixed a major bug introduced on the previous version.

## Version 1.1.7

- Added `randomPhone`.
Loading

0 comments on commit 2a4a6da

Please sign in to comment.