generated from pabio/github-actions-starter
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⬆️ Update koj-co/github-actions-starter
- Loading branch information
1 parent
c20403a
commit d60ca97
Showing
15 changed files
with
226 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ allowed: | |
- mit | ||
- cc0-1.0 | ||
- unlicense | ||
- bsd0 | ||
- 0bsd | ||
reviewed: | ||
npm: | ||
- "@actions/http-client" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
name: Build CI | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.vscode | ||
.licenses | ||
.github |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters