This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: GitHub Action to manage Review Apps on Heroku
- Loading branch information
Ryan Park
committed
May 10, 2022
1 parent
0936225
commit 5c093fb
Showing
19 changed files
with
13,295 additions
and
103 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = { | ||
extends: ['@readme/eslint-config'], | ||
plugins: ['node', 'import'], | ||
root: true, | ||
ignorePatterns: [], | ||
rules: { | ||
'import/extensions': [ | ||
'error', | ||
'ignorePackages', | ||
{ | ||
js: 'never', | ||
ts: 'never', | ||
}, | ||
], | ||
|
||
'import/namespace': ['error', { allowComputed: true }], | ||
'import/prefer-default-export': 'off', | ||
|
||
'no-console': ['error', { allow: ['log', 'warn', 'error'] }], | ||
'no-restricted-imports': ['error', { patterns: ['test'] }], | ||
'no-underscore-dangle': 'off', | ||
'sort-imports': 'error', | ||
|
||
'no-shadow': 'off', | ||
}, | ||
settings: { | ||
'require-await': 'error', | ||
'import/resolver': { | ||
alias: { | ||
map: [['@src', './src']], | ||
extensions: ['.js'], | ||
}, | ||
}, | ||
}, | ||
env: { | ||
jest: true, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,2 +1,26 @@ | ||
# heroku-review-app-action | ||
GitHub Action to create a new review app when invoked. (This might come in handy as a template for other Heroku customers but it's written specific to ReadMe's needs) | ||
|
||
## Caveats | ||
|
||
### This is a public repo | ||
|
||
In order to use this as a GitHub Action this repo must be public — even just for projects inside the `readme` org. Don't add anything proprietary here, _especially any kind of secrets!_ | ||
|
||
### node_modules | ||
|
||
The `node_modules` directory must be checked in to the repo in order to use this GitHub Action without a separate install step. | ||
|
||
Before committing changes to the `node_modules` directory, please prune dev dependencies from your local install. Example: | ||
|
||
```bash | ||
# Remove dev dependencies from your local node_modules directory | ||
$ npm prune --production | ||
|
||
# Commit your changes to package.json and node_modules | ||
$ git add node_modules package.json package-lock.json | ||
$ git commit -m "chore: update node_modules" | ||
|
||
# Reinstall all modules, including dev dependencies | ||
$ npm install | ||
``` |
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,21 @@ | ||
name: 'Heroku Review App Action' | ||
description: 'Creates a new Heroku review app when invoked' | ||
inputs: | ||
heroku_email: | ||
description: 'The email address for the Heroku user that generated the personal access token' | ||
required: true | ||
heroku_api_key: | ||
description: 'The personal access token to use to access the Heroku API' | ||
required: true | ||
pipeline_name: | ||
description: "The name of the Heroku pipeline where the app should be deployed" | ||
required: true | ||
github_token: | ||
description: 'GITHUB_TOKEN or a repo scoped PAT.' | ||
default: ${{ github.token }} | ||
outputs: | ||
comment: | ||
description: "A comment which can be posted to the pull request after the action finishes." | ||
runs: | ||
using: 'node16' | ||
main: 'index.js' |
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,5 @@ | ||
require('module-alias/register'); | ||
|
||
const main = require('@src/main'); | ||
|
||
main(); |
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 @@ | ||
require('module-alias/register'); | ||
|
||
module.exports = { | ||
testEnvironment: 'node', | ||
testRegex: '(/test/.*|(\\.|/)(test|spec))\\.(js?|ts?)$', | ||
testPathIgnorePatterns: ['/node_modules/'], | ||
coveragePathIgnorePatterns: ['node_modules', '/test'], | ||
roots: ['<rootDir>'], | ||
modulePaths: ['<rootDir>'], | ||
restoreMocks: true, | ||
}; |
Oops, something went wrong.