Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
feat: GitHub Action to manage Review Apps on Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Park committed May 10, 2022
1 parent 0936225 commit 5c093fb
Show file tree
Hide file tree
Showing 19 changed files with 13,295 additions and 103 deletions.
38 changes: 38 additions & 0 deletions .eslintrc.js
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,
},
};
103 changes: 0 additions & 103 deletions .gitignore

This file was deleted.

24 changes: 24 additions & 0 deletions README.md
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
```
21 changes: 21 additions & 0 deletions action.yml
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'
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require('module-alias/register');

const main = require('@src/main');

main();
11 changes: 11 additions & 0 deletions jest.config.js
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,
};
Loading

0 comments on commit 5c093fb

Please sign in to comment.