Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit f85a428

Browse files
⬆️ Update koj-co/template to latest
1 parent a996820 commit f85a428

16 files changed

+207
-84
lines changed

Diff for: .github/workflows/build.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,25 @@ jobs:
1010
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v2.3.4
1414
with:
1515
ref: ${{ github.head_ref }}
1616
token: ${{ secrets.GH_PAT }}
1717
- name: Setup Node.js
1818
uses: actions/[email protected]
1919
with:
2020
node-version: 14
21+
- name: Cache node modules
22+
uses: actions/cache@v2
23+
env:
24+
cache-name: cache-node-modules
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-build-${{ env.cache-name }}-
30+
${{ runner.os }}-build-
31+
${{ runner.os }}-
2132
- name: Install dependencies
2233
run: npm ci
2334
- name: Build TypeScript

Diff for: .github/workflows/cla.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PAT }}
1717
with:
1818
path-to-signatures: cla-signatures.json
19-
path-to-cla-document: https://github.com/koj-co/.github/blob/master/CLA.md
19+
path-to-document: https://github.com/koj-co/.github/blob/master/CLA.md
2020
allowlist: dependabot-preview[bot], dependabot[bot], greenkeeper[bot], *bot, bot*
2121
remote-organization-name: koj-co
2222
remote-repository-name: .github
23-
signed-commit-message: ":wrench: @$contributorName has signed the CLA in #$pullRequestNo"
2423
create-file-commit-message: ":wrench: Creating a file for storing CLA signatures"
24+
signed-commit-message: ":wrench: @$contributorName has signed the CLA in #$pullRequestNo"
2525
custom-allsigned-prcomment: "✍️ All contributors have signed the CLA"
26-
custom-notsigned-prcomment: "Thanks for your submission! We ask that $you sign our [Contributor License Agreement]($pathToCLADocument) before we can accept your contribution. You can sign the CLA by adding a comment below using this text:"
26+
custom-notsigned-prcomment: "Thanks for your submission! We ask that $you sign our [Contributor License Agreement](https://github.com/koj-co/.github/blob/master/CLA.md) before we can accept your contribution. You can sign the CLA by adding a comment below using this text:"

Diff for: .github/workflows/codeql.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CodeQL CI
2+
on:
3+
schedule:
4+
- cron: "0 0 * * 1"
5+
jobs:
6+
release:
7+
name: Build and analyze
8+
runs-on: ubuntu-18.04
9+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: Setup Node.js
14+
uses: actions/[email protected]
15+
with:
16+
node-version: 14
17+
- name: Initialize CodeQL
18+
uses: github/codeql-action/init@v1
19+
with:
20+
languages: javascript
21+
- name: Cache node modules
22+
uses: actions/cache@v2
23+
env:
24+
cache-name: cache-node-modules
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-build-${{ env.cache-name }}-
30+
${{ runner.os }}-build-
31+
${{ runner.os }}-
32+
- name: Install dependencies
33+
run: npm ci
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v1

Diff for: .github/workflows/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Dependabot PR CI
2+
on:
3+
schedule:
4+
- cron: "0 */6 * * *"
5+
workflow_dispatch:
6+
jobs:
7+
label-approve:
8+
name: Label and approve minor/patch updates
9+
runs-on: ubuntu-18.04
10+
steps:
11+
- uses: koj-co/dependabot-pr-action@master
12+
with:
13+
token: ${{ secrets.GH_PAT }}
14+
merge-minor: true
15+
merge-patch: true

Diff for: .github/workflows/feature-pr.yml

-20
This file was deleted.

Diff for: .github/workflows/hotfix-pr.yml

-19
This file was deleted.

Diff for: .github/workflows/licensed.yml

-35
This file was deleted.

Diff for: .github/workflows/node.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,22 @@ jobs:
1010
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v1
13+
uses: actions/checkout@v2.3.4.3.4
1414
- name: Setup Node.js
1515
uses: actions/[email protected]
1616
with:
1717
node-version: 12
18+
- name: Cache node modules
19+
uses: actions/cache@v2
20+
env:
21+
cache-name: cache-node-modules
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-build-${{ env.cache-name }}-
27+
${{ runner.os }}-build-
28+
${{ runner.os }}-
1829
- name: Install dependencies
1930
run: npm ci
2031
- name: Build TypeScript

Diff for: .github/workflows/pull-request.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: PR Generator CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- master
6+
- production
7+
jobs:
8+
auto-pull-request:
9+
name: PullRequestAction
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Generate branch name
13+
uses: actions/github-script@v3
14+
id: set-branch-name
15+
with:
16+
script: |
17+
const capitalize = (name) => name.charAt(0).toUpperCase() + name.slice(1);
18+
const emoji = context.payload.ref.startsWith("refs/heads/feature")
19+
? "✨ "
20+
: context.payload.ref.startsWith("refs/heads/hotfix")
21+
? "🚑 "
22+
: context.payload.ref.startsWith("refs/heads/bug")
23+
? "🐛 "
24+
: "";
25+
return `${emoji}${capitalize(
26+
context.payload.ref
27+
.replace("refs/heads/", "")
28+
.replace(/-/g, " ")
29+
.replace("feature ", "")
30+
.replace("bug ", "")
31+
.replace("hotfix ", "")
32+
)}`;
33+
result-encoding: string
34+
- name: Set branch name
35+
run: echo "PULL_REQUEST_TITLE=${{steps.set-branch-name.outputs.result}}" >> $GITHUB_ENV
36+
- name: Generate PR body
37+
uses: actions/github-script@v3
38+
id: set-pr-body
39+
with:
40+
script: |
41+
return `I'm opening this pull request for this branch, pushed by @${
42+
context.payload.head_commit.author.username
43+
} with ${context.payload.commits.length} commit${
44+
context.payload.commits.length === 1 ? "" : "s"
45+
}.`;
46+
result-encoding: string
47+
- name: Set PR body
48+
run: echo "PULL_REQUEST_BODY=${{steps.set-pr-body.outputs.result}}" >> $GITHUB_ENV
49+
- name: Generate PR draft
50+
uses: actions/github-script@v3
51+
id: set-pr-draft
52+
with:
53+
script: |
54+
return !context.payload.ref.startsWith("refs/heads/hotfix");
55+
- name: Set PR draft
56+
run: echo "PULL_REQUEST_DRAFT=${{steps.set-pr-draft.outputs.result}}" >> $GITHUB_ENV
57+
- name: Determine whether to merge
58+
uses: actions/github-script@v3
59+
id: should-pr
60+
with:
61+
github-token: ${{ secrets.GH_PAT }}
62+
script: |
63+
return
64+
context.payload.ref.startsWith("refs/heads/feature") ||
65+
context.payload.ref.startsWith("refs/heads/hotfix") ||
66+
context.payload.ref.startsWith("refs/heads/bug");
67+
- name: pull-request-action
68+
uses: vsoch/[email protected]
69+
if: always() && steps.should-pr.outputs.result
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
72+
PULL_REQUEST_BRANCH: "master"
73+
PULL_REQUEST_REVIEWERS: "AnandChowdhary"

Diff for: .github/workflows/release-scheduler.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Release Scheduler CI
2+
on:
3+
schedule:
4+
- cron: "0 0 * * 1"
5+
workflow_dispatch:
6+
jobs:
7+
releaseScheduler:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Run release-scheduler
11+
uses: koj-co/release-scheduler@master
12+
env:
13+
GH_PAT: ${{ secrets.GH_PAT }}

Diff for: .github/workflows/release.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,25 @@ jobs:
1010
if: "contains(github.event.head_commit.message, 'Deploy new version')"
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v2.3.4
1414
with:
1515
ref: ${{ github.head_ref }}
1616
token: ${{ secrets.GH_PAT }}
1717
- name: Setup Node.js
1818
uses: actions/[email protected]
1919
with:
2020
node-version: 14
21+
- name: Cache node modules
22+
uses: actions/cache@v2
23+
env:
24+
cache-name: cache-node-modules
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-build-${{ env.cache-name }}-
30+
${{ runner.os }}-build-
31+
${{ runner.os }}-
2132
- name: Install dependencies
2233
run: npm ci
2334
- name: Release

Diff for: .github/workflows/stale.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Stale Issues CI"
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
jobs:
6+
stale:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/stale@v3
10+
with:
11+
repo-token: ${{ secrets.GH_PAT }}
12+
stale-issue-message: "⚠️ This issue has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week."
13+
stale-pr-message: "⚠️ This PR has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week."
14+
days-before-stale: 60
15+
days-before-close: 7
16+
stale-issue-label: "wontfix"
17+
exempt-issue-labels: "wip"
18+
stale-pr-label: "wontfix"
19+
exempt-pr-labels: "wip"

Diff for: .github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
if: "contains(github.event.head_commit.message, 'Deploy new version')"
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v2.3.4
1414
- uses: ./
1515
with:
1616
milliseconds: 1000

Diff for: .npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vscode
2+
.licenses
3+
.github

Diff for: jest.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: "ts-jest",
3+
testEnvironment: "node",
4+
};

Diff for: tsconfig.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
"module": "commonjs",
66
"lib": ["dom", "esnext"],
77
"strict": true,
8-
"sourceMap": false,
9-
"declaration": false,
8+
"sourceMap": true,
9+
"declaration": true,
1010
"esModuleInterop": true,
1111
"allowSyntheticDefaultImports": true,
1212
"experimentalDecorators": true,
13+
"emitDecoratorMetadata": true,
14+
"declarationDir": "./dist",
1315
"outDir": "./dist",
1416
"typeRoots": ["node_modules/@types", "@types"]
1517
},
16-
"include": ["src"],
18+
"include": ["src", "tooling"],
1719
"exclude": ["node_modules"]
1820
}

0 commit comments

Comments
 (0)