Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a full example yaml file to the README for easy copy-pasting #6

Merged
merged 2 commits into from
Jun 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ versions available. Each version of the Fourmolu Action generally has a
corresponding version of `fourmolu`. Make sure you pick a Fourmolu Action
version that uses the version of `fourmolu` you use locally.

### Full Example

Here's a full YAML file you can copy and paste into your repo that runs
`fourmolu-action`. Add this as a file like `.github/workflows/fourmolu.yaml`.
This Workflow will run everytime you push to a branch.

```yaml
name: fourmolu
on: push
jobs:
format:
runs-on: ubuntu-latest
steps:
# Note that you must checkout your code before running fourmolu/fourmolu-action
- uses: actions/checkout@v2
- uses: fourmolu/fourmolu-action@v1
```

### Example with more Options

Here's a more complicated example that shows more options being used:

```yaml
Expand All @@ -39,7 +59,7 @@ Here's a more complicated example that shows more options being used:
extra-args: "--indent-wheres true"
```

## Example Usage with Build Matrix
### Example Usage with Build Matrix

If you are using a build matrix, then it is more efficient to have a
separate job for checking of formatting:
Expand All @@ -65,6 +85,9 @@ passes.
The available options are defined in [`./action.yml`](./action.yml). See that
file for more explanation.

<!-- fourmolu-action currently doesn't support running on Windows. -->
<!--

## Windows

If you are running a workflow on Windows, be wary of [Git's
Expand All @@ -76,6 +99,8 @@ disable `core.autocrlf`:
$ git config --global core.autocrlf false
```

-->

## Hacking on this repo

In order to do development on this repo, you first need to install NodeJS and
Expand Down