Skip to content

Commit

Permalink
feat: create action (#1)
Browse files Browse the repository at this point in the history
* feat: create action

* chore: build

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
abemedia and github-actions[bot] authored Aug 3, 2021
1 parent 8d0d597 commit 6eb1f22
Show file tree
Hide file tree
Showing 23 changed files with 11,152 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
extends: [
'plugin:@typescript-eslint/recommended',
'airbnb-typescript/base',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
ecmaVersion: 9,
sourceType: 'module',
project: './tsconfig.json',
},
rules: {
// No default exports
'import/no-default-export': 'error',
'import/prefer-default-export': 'off',

// Enforce import order and no spaces
'import/order': [
'error',
{
alphabetize: { order: 'asc', caseInsensitive: true },
'newlines-between': 'never',
},
],

// Sort import members
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
},
env: {
node: true,
es6: true,
},
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: daily

- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test & Build

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- run: yarn
- run: yarn tsc
- run: yarn lint
- run: yarn build
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore: build'
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com>
17 changes: 17 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check PR title

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
check-pr-title:
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
release-type: node

- uses: actions/checkout@v2
- name: tag major versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
git tag -d v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git push origin v${{ steps.release.outputs.major }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lib/
node_modules/

*.log
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all"
}
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @theappnest/devops
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# github-skip-checks-action

This GitHub action marks checks as successful if no changes occurred to specified files.

## Usage

```yaml
jobs:
skip_checks:
runs-on: ubuntu-latest
steps:
- uses: theappnest/github-skip-checks-action@master
with:
paths: |
foo/**
bar/**
checks: |
lint-foo-bar
test-foo-bar
```
## Inputs
- `token` (optional) GitHub token. Defaults to secrets.GITHUB_TOKEN.
- `paths` List of path globs to check for changes.
- `checks` List of checks to mark as successful.
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: terraform-monorepo-action
description: Marks checks as successful if no changes occurred to specified files.
author: DREST LTD
inputs:
token:
description: GitHub token. Defaults to secrets.GITHUB_TOKEN.
required: false
default: ${{ github.token }}
paths:
description: List of path globs to check for changes.
required: true
checks:
description: List of checks to mark as successful.
required: true
runs:
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit 6eb1f22

Please sign in to comment.