Skip to content

Commit

Permalink
๐Ÿถ feat(action) Implement v1
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleynguyen committed Mar 8, 2020
0 parents commit 9b13a4e
Show file tree
Hide file tree
Showing 19 changed files with 32,283 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/
64 changes: 64 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ "accessibility": "no-public" }
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ "allowExpressions": true }
],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error",
"eslint-comments/no-unlimited-disable": "off",
"eslint-comments/no-unused-disable": "off"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}
12 changes: 12 additions & 0 deletions .github/workflows/doggo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "doggo"

on: pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: stanleynguyen/action-dogs@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "build-test"

on:
pull_request:
push:
branches:
- master
- 'releases/*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm install
npm run all
107 changes: 107 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Ignore built ts files
__tests__/runner/*
lib/**/*
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "avoid",
"parser": "typescript"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Stanley Nguyen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<p align="center"><a href="https://github.com/stanleynguyen/action-dogs" target="_blank"><img width="300"src="https://media.giphy.com/media/9IRX12VhoXoR2/giphy.gif"></a></p>

<p align="center">
<a href="https://github.com/stanleynguyen/action-dogs/releases/latest"><img src="https://img.shields.io/github/release/stanleynguyen/action-dogs.svg"/></a>
<a href="https://github.com/stanleynguyen/action-dogs/actions?query=workflow%3Adoggo"><img src="https://github.com/stanleynguyen/action-dogs/workflows/doggo/badge.svg"/></a>
<a href="https://github.com/stanleynguyen/action-dogs/actions?query=workflow%3Abuild-test"><img src="https://github.com/stanleynguyen/action-dogs/workflows/build-test/badge.svg"/></a>
<a href="https://github.com/stanleynguyen/action-dogs/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg"/></a>
<p>

# action-dogs

๐Ÿถ๐Ÿ•๐Ÿฆฎ๐Ÿ•โ€๐Ÿฆบ๐Ÿฉ๐ŸŒญ dogs-as-a-github-action

It's impossible to think of anything better than a doggo gif after a long implementation.
Get doggo gifs delivered right into your PRs now!!

## Woof-woof

```yaml
- name: Doggoes as an Action
uses: stanleynguyen/action-dogs@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```
10 changes: 10 additions & 0 deletions __tests__/doggo/generator.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { generate } from '../../src/doggo/generator'

describe('doggo generator', () => {
test('to return a good boy', () => {
Math.random = jest.fn().mockReturnValue(0)
const good = 'https://media3.giphy.com/media/mCRJDo24UvJMA/giphy.gif'
const boy = generate()
expect(boy).toBe(good)
})
})
13 changes: 13 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Action Dogs'
description: 'Doggoes GIFs delivered into PRs'
author: 'Stanley Nguyen'
branding:
icon: 'camera-off'
color: 'yellow'
inputs:
github-token:
description: 'Pass in secrets.GITHUB_TOKEN'
required: true
runs:
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit 9b13a4e

Please sign in to comment.