Skip to content

Commit cf8714b

Browse files
⬆️ Update koj-co/template
1 parent 2013166 commit cf8714b

File tree

9 files changed

+192
-4
lines changed

9 files changed

+192
-4
lines changed

.github/workflows/automerge.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ jobs:
2727
MERGE_FORKS: false
2828
UPDATE_LABELS: "merge"
2929
UPDATE_METHOD: "merge"
30-
- name: Wait for 10s
31-
uses: jakejarvis/wait-action@master
32-
with:
33-
time: "10s"
3430
- name: Delete merged branch
3531
uses: koj-co/delete-merged-action@master
3632
with:

.github/workflows/codeql.yml

Lines changed: 35 additions & 0 deletions
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/checkout@v2.3.4
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v2.1.2
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

.github/workflows/dependabot.yml

Lines changed: 15 additions & 0 deletions
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

.github/workflows/node.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ jobs:
1515
uses: actions/setup-node@v2.1.2
1616
with:
1717
node-version: 14
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

.github/workflows/pull-request.yml

Lines changed: 73 additions & 0 deletions
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/pull-request-action@1.0.12
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"
Lines changed: 13 additions & 0 deletions
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 }}

.github/workflows/stale.yml

Lines changed: 19 additions & 0 deletions
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"

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- master
6+
jobs:
7+
release:
8+
name: Build and test
9+
runs-on: ubuntu-18.04
10+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2.3.4
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v2.1.2
16+
with:
17+
node-version: 14
18+
- name: Install dependencies
19+
run: npm ci
20+
- name: Build TypeScript
21+
run: npm run build
22+
- name: Run tests
23+
run: npm run test

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vscode
2+
.licenses
3+
.github

0 commit comments

Comments
 (0)