Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/julianrubisch/attractor-action

A Github action to run an Attractor report on your project
https://github.com/julianrubisch/attractor-action

code-quality github-action javascript rails react ruby vue

Last synced: 7 days ago
JSON representation

A Github action to run an Attractor report on your project

Awesome Lists containing this project

README

        

# Attractor Action

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)

A Github action to run an [Attractor](https://github.com/julianrubisch/attractor) report on your project.

## Table of Contents

* [Usage](#usage)
* [Example Workflow](#example-workflow)
* [Inputs](#inputs)
* [License](#license)
* [Contributors](#contributors)

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

```yml
- 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.

```yml
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 Name** | **Required** | **Default Value** | **Description** | **Examples of Equivalent Local Commands** |
| ------------------- | ------------ | ----------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| bundle | false | false | If you would like to run `bundle install` on your project instead of `gem install` | `bundle install --deployment --jobs 4 --retry 3` |
| version | false | latest GA | Define a different version of attractor | `gem install attractor -v 1.0.0` |
| file_prefix | false | '' | Specify a director (defaults to app root) | `attractor report --file-prefix app/models` |
| javascript | false | false | Set this to true if you would like to check javascript | `attractor report -t js` |

## License

MIT

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Andrew Mason

💻

Julian Rubisch

📖

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!