Attractor Action

December 18, 2019 ยท View on GitHub

All Contributors

A Github action to run an Attractor report on your project.

Table of Contents

Usage

Add the following to your GitHub action workflow to use Attractor Action:

- name: Run Attractor
  uses: julianrubisch/attractor-action@master
  with:
    version: 'latest'
    bundle: 'false'
    (file_prefix: 'app/models') - OPTIONAL
    (javascript: '(true|false)') - OPTIONAL

Example Workflow

The workflow below simply saves the attractor_output directory to a build artifact.

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with: 
        fetch-depth: '0'     # IMPORTANT!
    - name: Run Attractor
      uses: julianrubisch/attractor-action@master
      with:
        version: 'latest'
        bundle: 'false'
        (file_prefix: 'app/models') # OPTIONAL
        (javascript: '(true|false)') # OPTIONAL
    - name: Upload Artifact
      uses: actions/upload-artifact@v1
      if: success()
      with:
        name: attractor
        path: attractor_output

Alternatively, you could upload it to an AWS bucket, deploy it on Netlify,... you name it! PRs documenting usage are very welcome!

It's compulsory to set the fetch-depth attribute on the checkout action to 0, otherwise only the HEAD commit will be fetched, rendering the churn output useless (we need the full history).

Inputs

Input Parm NameRequiredDefault ValueDescriptionExamples of Equivalent Local Commands
bundlefalsefalseIf you would like to run bundle install on your project instead of gem installbundle install --deployment --jobs 4 --retry 3
versionfalselatest GADefine a different version of attractorgem install attractor -v 1.0.0
file_prefixfalse''Specify a director (defaults to app root)attractor report --file-prefix app/models
javascriptfalsefalseSet this to true if you would like to check javascriptattractor report -t js

License

MIT

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Andrew Mason

๐Ÿ’ป

Julian Rubisch

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!