forked from creyD/prettier_action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
87 lines (83 loc) · 3 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Prettier Action
description: Automatically runs prettier on all your changes.
author: Conrad Großer <grosserconrad@gmail.com>
inputs:
commit_message:
description: Commit message, will be ignored if used with same_commit
required: false
default: "Prettified Code!"
commit_description:
description: Extended commit message, will be ignored if used with same_commit
required: false
default: ""
same_commit:
description: Update the current commit instead of creating a new one
required: false
default: false
commit_options:
description: Commit options
required: false
push_options:
description: Git push options
required: false
file_pattern:
description: File pattern used for `git add`, can't be used with only_changed!
required: false
default: "*"
prettier_options:
description: Options for the `prettier` command
required: false
default: "--write **/*.js"
dry:
description: Running the script in dry mode just shows whether there are files that should be prettified or not
required: false
default: false
prettier_version:
description: Specific version of prettier (by default just use the latest version)
required: false
default: false
working_directory:
description: Specify a directory to cd into before installing prettier and running it
required: false
default: false
only_changed:
description: Only prettify files changed in the last commit, can't be used with file_pattern!
required: false
default: false
additional_dependencies:
description: Install additional dependencies (such as Prettier plugins), i.e. `@prettier/plugin-php @prettier/plugin-other`
required: false
default: ""
github_token:
description: GitHub Token or PAT token used to authenticate against a repository
required: false
default: ${{ github.token }}
clean_node_folder:
description: Remove the node_modules folder before committing changes
required: false
default: true
runs:
using: "composite"
steps:
- name: Prettify code!
shell: bash
run: >-
PATH=$GITHUB_ACTION_PATH/node_modules/.bin:$PATH
${{ github.action_path }}/entrypoint.sh
env:
INPUT_COMMIT_MESSAGE: ${{ inputs.commit_message }}
INPUT_COMMIT_DESCRIPTION: ${{ inputs.commit_description }}
INPUT_SAME_COMMIT: ${{ inputs.same_commit }}
INPUT_COMMIT_OPTIONS: ${{ inputs.commit_options }}
INPUT_FILE_PATTERN: ${{ inputs.file_pattern }}
INPUT_PRETTIER_OPTIONS: ${{ inputs.prettier_options }}
INPUT_DRY: ${{ inputs.dry }}
INPUT_PRETTIER_VERSION: ${{ inputs.prettier_version }}
INPUT_ONLY_CHANGED: ${{ inputs.only_changed }}
INPUT_ADDITIONAL_DEPENDENCIES: ${{ inputs.additional_dependencies }}
INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_CLEAN_NODE_FOLDER: ${{ inputs.clean_node_folder }}
branding:
icon: "award"
color: "green"