Skip to content

Commit cbb0a59

Browse files
committed
feat: add initial action script
1 parent ca7e7c2 commit cbb0a59

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

action.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Prettier Check'
2+
author: 'Rutaj Dash'
3+
description: 'A simple action which runs the Prettier CLI Check'
4+
inputs:
5+
file_pattern:
6+
description: 'The file pattern to scan'
7+
required: false
8+
default: '**/*.js'
9+
config_path:
10+
description: 'The path to the prettierrc file'
11+
required: false
12+
default: ''
13+
ignore_path:
14+
description: 'The path to the prettierignore file'
15+
required: false
16+
default: './.prettierignore'
17+
prettier_version:
18+
description: 'The version of prettier to install'
19+
required: false
20+
default: 'latest'
21+
22+
outputs:
23+
prettier_output:
24+
description: 'The output from prettier'
25+
value: ${{ steps.prettier-run.outputs.prettier-output }}
26+
27+
runs:
28+
using: 'composite'
29+
steps:
30+
- name: Installing Prettier
31+
id: prettier-install
32+
shell: bash
33+
run: npm install --global prettier@${{ inputs.prettier_version }}
34+
35+
- name: Running Prettier
36+
id: prettier-run
37+
shell: bash
38+
run: cd $GITHUB_ACTION_PATH && echo "::set-output name=prettier-output::$(prettier --check --config ${{ inputs.config_path }} --ignore-path ${{ inputs.ignore_path }} --no-error-on-unmatched-pattern ${{ inputs.file_pattern }})"
39+
40+
branding:
41+
icon: 'search'
42+
color: 'gray-dark'

0 commit comments

Comments
 (0)