Skip to content

Commit

Permalink
⬆️ Update koj-co/github-actions-starter
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 17, 2020
1 parent c20403a commit d60ca97
Show file tree
Hide file tree
Showing 15 changed files with 226 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/licensed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ allowed:
- mit
- cc0-1.0
- unlicense
- bsd0
- 0bsd
reviewed:
npm:
- "@actions/http-client"
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Build CI
on:
workflow_dispatch:
push:
branches:
- master
Expand All @@ -11,14 +10,25 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 12
node-version: 14
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Build TypeScript
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PAT }}
with:
path-to-signatures: cla-signatures.json
path-to-cla-document: https://github.com/koj-co/.github/blob/master/CLA.md
path-to-document: https://github.com/koj-co/.github/blob/master/CLA.md
allowlist: dependabot-preview[bot], dependabot[bot], greenkeeper[bot], *bot, bot*
remote-organization-name: koj-co
remote-repository-name: .github
signed-commit-message: ":wrench: @$contributorName has signed the CLA in #$pullRequestNo"
create-file-commit-message: ":wrench: Creating a file for storing CLA signatures"
signed-commit-message: ":wrench: @$contributorName has signed the CLA in #$pullRequestNo"
custom-allsigned-prcomment: "✍️ All contributors have signed the CLA"
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:"
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:"
35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CodeQL CI
on:
schedule:
- cron: "0 0 * * 1"
jobs:
release:
name: Build and analyze
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 14
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
15 changes: 15 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Dependabot PR CI
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
label-approve:
name: Label and approve minor/patch updates
runs-on: ubuntu-18.04
steps:
- uses: koj-co/dependabot-pr-action@master
with:
token: ${{ secrets.GH_PAT }}
merge-minor: true
merge-patch: true
13 changes: 12 additions & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,22 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2.3.4
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 12
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Build TypeScript
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: PR Generator CI
on:
push:
branches-ignore:
- master
- production
jobs:
auto-pull-request:
name: PullRequestAction
runs-on: ubuntu-latest
steps:
- name: Generate branch name
uses: actions/github-script@v3
id: set-branch-name
with:
script: |
const capitalize = (name) => name.charAt(0).toUpperCase() + name.slice(1);
const emoji = context.payload.ref.startsWith("refs/heads/feature")
? "✨ "
: context.payload.ref.startsWith("refs/heads/hotfix")
? "🚑 "
: context.payload.ref.startsWith("refs/heads/bug")
? "🐛 "
: "";
return `${emoji}${capitalize(
context.payload.ref
.replace("refs/heads/", "")
.replace(/-/g, " ")
.replace("feature ", "")
.replace("bug ", "")
.replace("hotfix ", "")
)}`;
result-encoding: string
- name: Set branch name
run: echo "PULL_REQUEST_TITLE=${{steps.set-branch-name.outputs.result}}" >> $GITHUB_ENV
- name: Generate PR body
uses: actions/github-script@v3
id: set-pr-body
with:
script: |
return `I'm opening this pull request for this branch, pushed by @${
context.payload.head_commit.author.username
} with ${context.payload.commits.length} commit${
context.payload.commits.length === 1 ? "" : "s"
}.`;
result-encoding: string
- name: Set PR body
run: echo "PULL_REQUEST_BODY=${{steps.set-pr-body.outputs.result}}" >> $GITHUB_ENV
- name: Generate PR draft
uses: actions/github-script@v3
id: set-pr-draft
with:
script: |
return !context.payload.ref.startsWith("refs/heads/hotfix");
- name: Set PR draft
run: echo "PULL_REQUEST_DRAFT=${{steps.set-pr-draft.outputs.result}}" >> $GITHUB_ENV
- name: Determine whether to merge
uses: actions/github-script@v3
id: should-pr
with:
github-token: ${{ secrets.GH_PAT }}
script: |
return
context.payload.ref.startsWith("refs/heads/feature") ||
context.payload.ref.startsWith("refs/heads/hotfix") ||
context.payload.ref.startsWith("refs/heads/bug");
- name: pull-request-action
uses: vsoch/[email protected]
if: always() && steps.should-pr.outputs.result
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
PULL_REQUEST_BRANCH: "master"
PULL_REQUEST_REVIEWERS: "AnandChowdhary"
13 changes: 13 additions & 0 deletions .github/workflows/release-scheduler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release Scheduler CI
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
releaseScheduler:
runs-on: ubuntu-latest
steps:
- name: Run release-scheduler
uses: koj-co/release-scheduler@master
env:
GH_PAT: ${{ secrets.GH_PAT }}
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,25 @@ jobs:
if: "contains(github.event.head_commit.message, 'Deploy new version')"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 14
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Release
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Stale Issues CI"
on:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GH_PAT }}
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."
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."
days-before-stale: 60
days-before-close: 7
stale-issue-label: "wontfix"
exempt-issue-labels: "wip"
stale-pr-label: "wontfix"
exempt-pr-labels: "wip"
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test CI
on:
push:
branches:
- master
jobs:
test:
name: Test action
runs-on: ubuntu-18.04
if: "contains(github.event.head_commit.message, 'Deploy new version')"
steps:
- name: Checkout
uses: actions/[email protected]
- uses: ./
with:
milliseconds: 1000
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode
.licenses
.github
3 changes: 0 additions & 3 deletions .templaterc.json

This file was deleted.

4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
"module": "commonjs",
"lib": ["dom", "esnext"],
"strict": true,
"sourceMap": false,
"declaration": false,
"sourceMap": true,
"declaration": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declarationDir": "./dist",
"outDir": "./dist",
"typeRoots": ["node_modules/@types", "@types"]
},
"include": ["src"],
"include": ["src", "tooling"],
"exclude": ["node_modules"]
}

0 comments on commit d60ca97

Please sign in to comment.