Skip to content

Commit

Permalink
init repo
Browse files Browse the repository at this point in the history
  • Loading branch information
polunzh committed Apr 11, 2022
0 parents commit af00c54
Show file tree
Hide file tree
Showing 14 changed files with 20,307 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
parser: 'babel-eslint',
plugins: ['import'],
extends: '@arcblock/eslint-config-base',
env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
node: true,
mocha: true,
},
rules: {
'unicorn/filename-case': [
'error',
{
cases: {
kebabCase: true,
},
ignore: ['setupProxy.js', 'App.js'],
},
],
'no-await-in-loop': 'off',
},
parserOptions: {
ecmaVersion: 2018,
},
};
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Test'
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- run: yarn install
- run: yarn test
19 changes: 19 additions & 0 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Check Version'
on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 16
- run: yarn install
- uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
yarn-error.log
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "es5",
"jsxBracketSameLine": true,
"semi": true,
"singleQuote": true
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# action-version-check

This is a Github Action that ensures that your PR has updated version.

## Usage

```yml
name: "Check Version"
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
branches:
- master
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: action-version-check@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## Rules
1. The updated version must be larger than the current version
1. Version updates greater than 1 are not allowed. e.g. 1.0.0 -> 1.0.3, 1.0.0 -> 1.2.0, 1.3.3 -> 3.0.0, such updates will fail
1. To update the major version, then you need to include [release-major] in the PR title
1. To update the minor version, then you need to include [release-minor] in the PR title
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: action-version-check
author: zhenqiang <[email protected]>
description: Check if the current version is compliant with the specification.
runs:
using: 'node16'
main: 'dist/index.js'
branding:
icon: 'shield'
color: 'green'
Loading

0 comments on commit af00c54

Please sign in to comment.