-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
6,246 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# https://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
|
||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{diff,patch}] | ||
trim_trailing_whitespace = false |
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 @@ | ||
SECRET= | ||
SCRIPT= | ||
PORT=number=32490 | ||
VERBOSE=boolean=false |
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,11 @@ | ||
{ | ||
"extends": "@jessety", | ||
"overrides": [ | ||
{ | ||
"files": ["**/*.test.{js,cjs}"], | ||
"parserOptions": { "sourceType": "script" }, | ||
"env": { "jest": true }, | ||
"rules": { "no-console": "warn" } | ||
} | ||
] | ||
} |
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,36 @@ | ||
name: ci | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
- run: npm install | ||
- run: npm run lint | ||
env: | ||
CI: true | ||
|
||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node: [14.x, 12.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: npm install | ||
- run: npm run test | ||
env: | ||
CI: 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events for tags matching v*, e.g. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # git history won't be fetched without this option | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Generate Release Notes | ||
run: npx auto-changelog --template RELEASE.md.hbs --output RELEASE.md --commit-limit false | ||
|
||
- name: Parse Release Notes | ||
id: parse | ||
run: | | ||
NOTES=$(cat RELEASE.md) | ||
NOTES="${NOTES//'%'/'%25'}" | ||
NOTES="${NOTES//$'\n'/'%0A'}" | ||
echo "::set-output name=notes::$NOTES" | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: ${{ steps.parse.outputs.notes }} | ||
draft: false | ||
prerelease: false |
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,11 @@ | ||
node_modules | ||
coverage | ||
.env | ||
|
||
RELEASE.md | ||
|
||
**/*.swp | ||
**/.DS_Store | ||
**/.Spotlight-V100 | ||
**/[Tt]humbs.db | ||
**/[Dd]esktop.ini |
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,8 @@ | ||
{ | ||
"recommendations": [ | ||
"editorconfig.editorconfig", | ||
"dbaeumer.vscode-eslint", | ||
"mikestead.dotenv" | ||
], | ||
"unwantedRecommendations": [] | ||
} |
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,9 @@ | ||
{ | ||
"search.exclude": { | ||
"coverage:": true, | ||
"node_modules": true | ||
}, | ||
"files.associations": { | ||
".env.defaults": "dotenv" | ||
} | ||
} |
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 +1,31 @@ | ||
# github-webhook | ||
# github-webhook | ||
|
||
A minimal GitHub webhook listener that executes a specified command when a release is published. | ||
|
||
## Installation | ||
|
||
```bash | ||
git clone ... | ||
cd github-webhook | ||
npm install --production | ||
pm2 start ecosystem.config.json | ||
``` | ||
|
||
## Configuration | ||
|
||
Edit an `.env` file in the project directory with the following options: | ||
|
||
```ini | ||
# GitHub Webhook Secret | ||
SECRET=ABC123 | ||
|
||
# Script to execute when a release is published | ||
SCRIPT=/usr/bin/local/update.sh | ||
|
||
# Port to run the server on | ||
PORT=32490 | ||
``` | ||
|
||
## License | ||
|
||
MIT © Jesse Youngblood |
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,16 @@ | ||
{{#each releases}} | ||
{{#if @first}} | ||
{{#if summary}} | ||
{{summary}} | ||
{{/if}} | ||
{{#each merges}} | ||
- {{message}}{{#if href}} [`#{{id}}`]({{href}}){{/if}} | ||
{{/each}} | ||
{{#each fixes}} | ||
- {{commit.subject}}{{#each fixes}}{{#if href}} [`#{{id}}`]({{href}}){{/if}}{{/each}} | ||
{{/each}} | ||
{{#each commits}} | ||
- {{subject}}{{#if href}} [`{{shorthash}}`]({{href}}){{/if}} | ||
{{/each}} | ||
{{/if}} | ||
{{/each}} |
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,12 @@ | ||
{ | ||
"apps": [{ | ||
|
||
"name": "github-webhook", | ||
|
||
"cwd": "./", | ||
"script": "src/index.js", | ||
|
||
"watch": true, | ||
"ignore_watch": [".git", "**/.DS_Store"] | ||
}] | ||
} |
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 @@ | ||
{ | ||
"collectCoverageFrom": ["src/*.js"] | ||
} |
Oops, something went wrong.