Skip to content

Commit 67975ef

Browse files
author
ADMSK\AVROGAL1
committed
docs: updates on workflows
Added information on documentation
1 parent ab5da0f commit 67975ef

16 files changed

Lines changed: 435 additions & 73 deletions

.eslintrc.json

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
{
2-
"plugins": [
3-
"jest",
4-
"@typescript-eslint",
5-
"spellcheck"
6-
],
2+
"plugins": ["jest", "@typescript-eslint", "spellcheck", "eslint-comments", "unicorn"],
3+
"settings": {
4+
"import/parsers": {
5+
"@typescript-eslint/parser": [".ts", ".js"]
6+
},
7+
"import/resolver": {
8+
"typescript": {}
9+
}
10+
},
711
"extends": [
8-
"plugin:github/recommended"
12+
"eslint:recommended",
13+
"plugin:github/recommended",
14+
"plugin:eslint-comments/recommended",
15+
"plugin:unicorn/recommended",
16+
"plugin:@typescript-eslint/recommended",
17+
"prettier",
18+
"prettier/@typescript-eslint"
919
],
1020
"parser": "@typescript-eslint/parser",
1121
"parserOptions": {
@@ -14,40 +24,26 @@
1424
"project": "./tsconfig.json"
1525
},
1626
"rules": {
17-
"indent": [
18-
"error",
19-
4
20-
],
21-
"linebreak-style": [
22-
"error",
23-
"unix"
24-
],
25-
"jsx-quotes": [
26-
"error",
27-
"prefer-double"
28-
],
27+
"indent": ["error", 4],
28+
"linebreak-style": ["error", "unix"],
29+
"jsx-quotes": ["error", "prefer-double"],
2930
"quotes": [
3031
"error",
3132
"single",
3233
{
3334
"avoidEscape": true
3435
}
3536
],
36-
"comma-dangle": [
37-
"error",
38-
"only-multiline"
39-
],
37+
"comma-dangle": ["error", "only-multiline"],
4038
"no-case-declarations": "off",
4139
"eqeqeq": "warn",
42-
"quote-props": [
43-
"warn",
44-
"consistent-as-needed"
45-
],
40+
"quote-props": ["warn", "consistent-as-needed"],
4641
"no-console": "off",
4742
"no-shadow": "off",
4843
"no-alert": "error",
4944
"no-caller": "error",
5045
"no-eval": "error",
46+
"no-undef": "warn",
5147
"no-implied-eval": "error",
5248
"no-extend-native": "error",
5349
"no-implicit-globals": "error",
@@ -58,10 +54,14 @@
5854
"keyword-spacing": "error",
5955
"eslint-comments/no-use": "off",
6056
"import/no-namespace": "off",
57+
"import/namespace": "off",
6158
"no-unused-vars": "off",
6259
"camelcase": "off",
6360
"no-invalid-this": "off",
6461
"no-angle-bracket-type-assertion": "off",
62+
"unicorn/filename-case": "off",
63+
"unicorn/prevent-abbreviations": "off",
64+
"unicorn/no-nested-ternary": "off",
6565
"spellcheck/spell-checker": [
6666
"off",
6767
{
@@ -134,17 +134,15 @@
134134
"checkLoops": false
135135
}
136136
],
137-
"dot-location": [
138-
"error",
139-
"property"
140-
],
137+
"dot-location": ["error", "property"],
141138
"brace-style": [
142139
"error",
143140
"1tbs",
144141
{
145142
"allowSingleLine": true
146143
}
147144
],
145+
"@typescript-eslint/explicit-module-boundary-types": "off",
148146
"@typescript-eslint/no-unused-vars": "error",
149147
"@typescript-eslint/explicit-member-accessibility": [
150148
"error",
@@ -163,10 +161,7 @@
163161
"allowExpressions": true
164162
}
165163
],
166-
"@typescript-eslint/func-call-spacing": [
167-
"error",
168-
"never"
169-
],
164+
"@typescript-eslint/func-call-spacing": ["error", "never"],
170165
"@typescript-eslint/no-array-constructor": "error",
171166
"@typescript-eslint/no-empty-interface": "error",
172167
"@typescript-eslint/no-explicit-any": "off",
@@ -188,10 +183,7 @@
188183
"@typescript-eslint/require-array-sort-compare": "error",
189184
"@typescript-eslint/restrict-plus-operands": "off",
190185
"semi": "off",
191-
"@typescript-eslint/semi": [
192-
"error",
193-
"never"
194-
],
186+
"@typescript-eslint/semi": ["error", "never"],
195187
"@typescript-eslint/type-annotation-spacing": "error",
196188
"@typescript-eslint/unbound-method": "off",
197189
"@typescript-eslint/member-ordering": "off",

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
- name: Build project
4444
run: |
45-
pnpm run all --if-present
45+
pnpm run build --if-present
4646
4747
- name: Run tests
4848
run: |

.github/workflows/close_pr.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Close Pull Request
2+
3+
on:
4+
pull_request:
5+
branches-ignore: [ master ]
6+
types: [ opened, reopened ]
7+
8+
jobs:
9+
# close any fork PRs not opened by trilom to anything but master
10+
close_pr:
11+
name: close non master PRs from fork
12+
runs-on: ubuntu-latest
13+
if: (github.actor != 'trilom' || github.actor != 'trilom-bot') && github.event.pull_request.head.repo.full_name != github.repository
14+
steps:
15+
- uses: superbrothers/close-pull-request@v2
16+
with:
17+
comment: Please merge your code into master, this will trigger the desired merge workflow.
18+
- uses: actions/github@v1.0.0
19+
if: success()
20+
with:
21+
args: label "doesnt read directions"

.github/workflows/pull_request.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'Auto Assign'
2+
3+
on: pull_request
4+
5+
jobs:
6+
add-reviews:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: kentaro-m/auto-assign-action@v1.1.2
10+
with:
11+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/readme.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
2+
# Workflow Information
3+
4+
- [Workflow Information](#workflow-information)
5+
- [Overview](#overview)
6+
- [Schedule](#schedule)
7+
- [Issue Comment](#issue-comment)
8+
- [Pull Request](#pull-request)
9+
- [Push](#push)
10+
11+
# Overview
12+
13+
1. Make a **Pull Request** from your forked branch (forked from _master_) with changes to _trilom/file-changes-action/master_ branch.
14+
2. Once merged into master this will lint the code and provide output in the checks, update the AUTHORS file, and package _dist/_. If there is a release then this will create a **Pull Request** from the _v\*\*_ branch to _master_ and a comment will be made on the original **Pull Request** notifying contributors. If there is not a release the changes will be **push**ed to _master_.
15+
3. In the **Pull Request** linting and testing will be performed again. If _linted_, _tested-unit_, _tested-integration_, _builds_, and _lintdogged_ label exist and _hold merge_ does not the release will be merged into _master_.
16+
4. Once merged this time [semantic-release](https://github.com/semantic-release/semantic-release) will run to create the Github Release, release notes, changelog, notify Slack, package and deploy to NPM and Github Package Repo, label the release, and notify any issues of it's deployment.
17+
5. After user semantic-release-bot commits the release commit, this code will be pushed to the release branch.
18+
19+
## Schedule
20+
21+
- Everyday at 5:00 AM GMT:
22+
- Run integration tests via Github Actions.
23+
24+
## Issue Comment
25+
26+
- When any `created` **Issue Comment** type runs on a **Pull Request** from trilom with the body of `/integrationNUMBER`(**integration.yml**):
27+
- Run integration tests via Github Actions with PR.
28+
- **NOT IMPLEMENTED** When any `created` **Issue Comment** type runs on a **Pull Request** from trilom with the body of `/release`(**automerge.yml**):
29+
- If _linted_, _tested-unit_, _tested-integration_, _builds_, _lintdogged_, and _hold merge_ or _automated merge_ **does not** labels exist:
30+
- Merge the PR and add the _automated merge_ label
31+
- If failure, put some output on the original PR.
32+
33+
## Pull Request
34+
35+
- When any `opened`, `reopened`, or `synchronize` **Pull Request** type runs to the _master_ branch from a _v\*\*_ branch:
36+
- Run integration tests via Github Actions.
37+
38+
- When any `opened` or `reopened` **Pull Request** type runs on any branch other than _master_ from anyone other than trilom or trilom-bot from a forked branch(**close_pr.yml**):
39+
- Close the **Pull Request** and put the dunce cap on.
40+
41+
- When any `labeled`, or `closed` **Pull Request** type runs on _master_, _next_, _alpha_, or _beta_(**automerge.yml**):
42+
- If _linted_, _tested-unit_, _tested-integration_, _builds_, _lintdogged_, and _hold merge_ or _automated merge_ **does not** labels exist:
43+
- Merge the PR and add the _automated merge_ label
44+
- If failure, put some output on the original PR.
45+
46+
- When any `opened`, `reopened`, or `synchronize` **Pull Request** type runs(**pr.yml**):
47+
- Assign it to trilom (**add-reviews**)
48+
- Build code with `yarn build` which runs `yarn` and `tsc` (**build**)
49+
- Label with builds if passing and on inner workspace
50+
- Test code with `yarn test-coverage` which runs `jest --coverage` (**test-unit**)
51+
- Label with tested-unit if passing and on inner workspace
52+
- Test code with `yarn test-integration` which runs `jest -c jest.config.integration.js` (**test-integration**)
53+
- Label with tested-integration if passing and on inner workspace
54+
- Test code with eslint reviewdog and report back if inner workspace (**lintdog**)
55+
- Label with pretty if passing and on inner workspace
56+
- Check format of code with `yarn format-check` which runs `prettier --check` (**format_check_push**)
57+
- If:
58+
- Fork then pull **Pull Request** github.ref with GITHUB_TOKEN
59+
- Inner **Pull Request** then pull HEAD repo ref
60+
- Build code with `yarn build` which runs `yarn` and `tsc`
61+
- If format-check succeeds and on inner workspace
62+
- Label with pretty
63+
- If format-check fails and on inner workspace and actor is not trilom-bot
64+
- Run `yarn format` which runs `prettier --write`
65+
- Clean build files with `yarn clean`
66+
- Commit the format changes as trilom-bot to **Pull Request** head
67+
68+
## Push
69+
70+
- When any **Push** type runs to _master_:
71+
- Run integration tests via Github Actions.
72+
- When any **Push** type runs to _master_, _next_, _alpha_, or _beta_(**push.yml**):
73+
- Build code with `yarn build` which runs `yarn` and `tsc` (**build**)
74+
- Test code with `yarn test-coverage` which runs `jest` (**test**)
75+
- Test code with eslint reviewdog and report back with github checks(**lintdog**)
76+
- When any **Push** type runs to _master_, _next_, _alpha_, or _beta_ with a head_commit message **NOT** containing 'trilom/v1.' or 'trilom/v2.':
77+
- Build with `yarn build-release` which runs `yarn && tsc --build tsconfig.build.json && ncc build --minify` to build the **dist/\*\*.js** files, update **AUTHORS**, format **src/\*\*.ts** files and commit.
78+
- Test [semantic-release](https://github.com/semantic-release/semantic-release) if a release is ready then create a **Pull Request**
79+
- Echo release outputs
80+
- Get changed files with [file-changes-action](https://github.com/trilom/file-changes-action) and build a message to post to new **Pull Request**
81+
- Comment on the original **Pull Request** with the new details of the release.
82+
- If no release, then **Push** changes directly back to master.
83+
- When any **Push** type runs to _master_, _next_, _alpha_, or _beta_ with a head_commit message containing 'trilom/v1.' or 'trilom/v2.':
84+
- Run [semantic-release](https://github.com/semantic-release/semantic-release) to prepare Github Release, release notes, changelog, notify Slack, package and deploy to NPM and Github Package Repo, label the release, and notify any issues of it's deployment.
85+
- When any **Push** type runs to _master_, _next_, _alpha_, or _beta_ from semantic-release-bot with a head_commit message containing 'chore(release):':
86+
- Get the **Pull Request** number from the **Push** and push the semantic-release changes to the tagged release branch.

.gitignore

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Log files
22
*.log
3+
logs
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
38

49
# BlueJ files
510
*.ctxt
611

712
# Cache files
13+
.npm
814
.eslintcache
915

1016
# Package files
@@ -15,14 +21,27 @@
1521
*.zip
1622
*.tar.gz
1723
*.rar
18-
*.map
24+
*.tgz
1925
**/.DS_Store
2026

2127
# License files
2228
licenses.json
2329

2430
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2531
hs_err_pid*
32+
pids
33+
*.pid
34+
*.seed
35+
*.pid.lock
36+
37+
# Yarn Integrity file
38+
.yarn-integrity
39+
40+
# TypeScript cache
41+
*.tsbuildinfo
42+
43+
# Optional REPL history
44+
.node_repl_history
2645

2746
# Build and temp folders
2847
.settings/

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [0.0.0-dev](https://github.com/AlexRogalskiy/github-action-json-fields/compare/v2.0.1...v0.0.0-dev) (2021-03-27)
1+
# [0.0.0-dev](https://github.com/AlexRogalskiy/github-action-json-fields/compare/v2.0.1...v0.0.0-dev) (2021-03-30)
22

33

44

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)