forked from Moonsong-Labs/toml_sort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
36 lines (33 loc) · 1.14 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: "TOML Sort"
author: "Off-Narrative Labs"
description: "Sort and format TOML files"
branding:
icon: "check-circle"
color: "green"
inputs:
files:
description: "List of files to check, if all is unset. Default is Cargo.toml."
required: true
default: "Cargo.toml"
all:
description: "Performs check on all the TOML files it can find, starting from current directory."
required: true
default: false
match:
description: "If all is set, performs checks on all the TOML files it can find that match this string."
required: true
default: "*.toml"
runs:
using: "composite"
steps:
- name: "Installing TOML Sort"
shell: "bash"
run: curl https://github.com/Off-Narrative-Labs/toml_sort/releases/download/v1.1.0/toml-sort-x86_64-unknown-linux-gnu.tar.gz -L | tar -xz
- if: ${{ inputs.all }}
name: "Running TOML Sort check"
shell: "bash"
run: find . -type f -iname "${{ inputs.match }}" -not -path "./target/*" | xargs -L1 ./toml-sort --check
- if: ${{ !inputs.all }}
name: "Running TOML Sort check"
shell: "bash"
run: ./toml-sort --check {{ inputs.files }}