Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Apr 10, 2023
1 parent 3ee7387 commit 450dc83
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ on:
pull_request:
branches: [master]

env:
SRC_DIR: src/github.com/${{ github.repository }}

jobs:
Aligo:
name: Aligo
Expand All @@ -31,17 +28,14 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17.x'
go-version: '1.18.x'

- name: Checkout
uses: actions/checkout@v3
with:
path: ${{env.SRC_DIR}}

- name: Check Golang sources with Aligo
uses: essentialkaos/aligo-action@v1
uses: essentialkaos/aligo-action@v2
with:
path: ${{env.SRC_DIR}}
files: ./...

```
Expand All @@ -50,8 +44,8 @@ jobs:

| Option | Description | Value |
|--------|-------------|--------|
| `path` | Path to directory with sources | _Path_ |
| `files` | Files or directories to check | _List_ |
| `path` | Path to directory with sources | _Path_ |
| `version` | Aligo version | _Version in semver notation_ |

### License
Expand Down
20 changes: 12 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ branding:
color: 'white'

inputs:
path:
description: "Path to directory with sources"
required: true

files:
description: "Files or directories to check"
required: true

path:
description: "Path to directory with sources"
required: false

version:
description: "Version of Aligo"
required: false
default: "1.6.0"
default: "latest"

runs:
using: "composite"
Expand Down Expand Up @@ -56,6 +56,10 @@ runs:
echo -e "\033[34mRunning Aligo…\033[0m"
pushd ${{inputs.path}} &> /dev/null
~/.cache/aligo check ${{inputs.files}}
popd &> /dev/null
if [[ -n "${{inputs.path}}" ]] ; then
pushd ${{inputs.path}} &> /dev/null
~/.cache/aligo check ${{inputs.files}}
popd &> /dev/null
else
~/.cache/aligo check ${{inputs.files}}
fi

0 comments on commit 450dc83

Please sign in to comment.