Skip to content

Commit e0e599a

Browse files
⬆️ Update koj-co/template
1 parent 9d36f80 commit e0e599a

8 files changed

+102
-57
lines changed

.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

.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

.github/workflows/hotfix-pr.yml

-52
This file was deleted.

.github/workflows/node.yml

+11
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ jobs:
1515
uses: actions/[email protected]
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/feature-pr.yml .github/workflows/pull-request.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Feature Branch Pull Request
1+
name: PR Generator CI
22
on:
33
push:
44
branches-ignore:
@@ -19,12 +19,15 @@ jobs:
1919
? "✨ "
2020
: context.payload.ref.startsWith("refs/heads/hotfix")
2121
? "🚑 "
22+
: context.payload.ref.startsWith("refs/heads/bug")
23+
? "🐛 "
2224
: "";
2325
return `${emoji}${capitalize(
2426
context.payload.ref
2527
.replace("refs/heads/", "")
2628
.replace(/-/g, " ")
2729
.replace("feature ", "")
30+
.replace("bug ", "")
2831
.replace("hotfix ", "")
2932
)}`;
3033
result-encoding: string
@@ -43,11 +46,28 @@ jobs:
4346
result-encoding: string
4447
- name: Set PR body
4548
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");
4667
- name: pull-request-action
47-
uses: vsoch/[email protected]
68+
uses: vsoch/[email protected]
69+
if: always() && steps.should-pr.outputs.result
4870
env:
4971
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
50-
BRANCH_PREFIX: "feature-"
5172
PULL_REQUEST_BRANCH: "master"
5273
PULL_REQUEST_REVIEWERS: "AnandChowdhary"
53-
PULL_REQUEST_DRAFT: true
+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 }}

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- master
66
jobs:
77
release:
8-
name: Build, test, and release
8+
name: Build and test
99
runs-on: ubuntu-18.04
1010
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1111
steps:

.npmignore

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

0 commit comments

Comments
 (0)