-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Create initial bash-based action
- Loading branch information
Kasper Hesthaven
committed
Sep 22, 2020
0 parents
commit 62224c2
Showing
6 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"Verbose": false, | ||
"Debug": false, | ||
"IgnoreDefaults": false, | ||
"SpacesAftertabs": false, | ||
"NoColor": false, | ||
"exclude": ["testfiles"], | ||
"AllowedContentTypes": [], | ||
"PassedFiles": [], | ||
"Disable": { | ||
"EndOfLine": false, | ||
"Indentation": false, | ||
"InsertFinalNewline": false, | ||
"TrimTrailingWhitespace": false, | ||
"IndentSize": false, | ||
"MaxLineLength": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = crlf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
curly_bracket_next_line = false | ||
spaces_around_operators = false | ||
spaces_around_brackets = both | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
indent_size = 2 | ||
|
||
[*{.yml,.ecrc,.nix}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# setup-editorconfig-checker | ||
|
||
This action downloads [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) by version number and adds it to your path, enabling you to check if your files consider your .editorconfig-rules, regardless of filetype. | ||
|
||
# Usage | ||
|
||
See [action.yml](action.yml) | ||
|
||
Basic: | ||
|
||
```yaml | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install editorconfig-checker | ||
- uses: kasperhesthaven/editorconfig-checker@v1 | ||
with: | ||
version: "2.1.0" # Defaults to latest if not set | ||
|
||
- name: Lint | ||
- run: editorconfig-checker | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: "Setup editorconfig-checker" | ||
description: "Downloads the editorconfig-checker binary by version number and adds it to your PATH" | ||
author: "Kasper Hesthaven" | ||
branding: | ||
icon: play | ||
color: green | ||
inputs: | ||
version: | ||
description: "Version to download, e.g., 2.1.0 or 2.0.4. (default: latest)" | ||
required: false | ||
command-name: | ||
description: "Set editorconfig-checker command name, e.g., 'ec'. (default: editorconfig-checker)" | ||
required: false | ||
default: "editorconfig-checker" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Assign latest version if version not provided | ||
run: | | ||
if [ -z ${{ inputs.version }} ]; then | ||
echo "::set-env name=VERSION::$(curl --silent "https://api.github.com/repos/editorconfig-checker/editorconfig-checker/releases/latest" | jq -r .tag_name)" | ||
else | ||
echo "::set-env name=VERSION::${{ inputs.version }}" | ||
fi | ||
shell: bash | ||
|
||
- name: Assign lowercase runner env | ||
run: | | ||
echo "::set-env name=OS::$(uname -s | tr '[:upper:]' '[:lower:]')" | ||
echo "::set-env name=ARCH::amd64" | ||
shell: bash | ||
|
||
- name: Download & add to path as editorconfig-checker | ||
run: | | ||
mkdir /home/runner/editorconfig-checker & cd "$_" | ||
echo "Downloading editorconfig-checker version $VERSION for $OS-$ARCH from https://github.com/editorconfig-checker/editorconfig-checker/releases/download/$VERSION/ec-$OS-$ARCH.tar.gz" | ||
curl -L https://github.com/editorconfig-checker/editorconfig-checker/releases/download/$VERSION/ec-$OS-$ARCH.tar.gz | tar zx --strip-components 1 | ||
mv ec-$OS-$ARCH ${{ inputs.command-name }} | ||
echo "Adding editorconfig-checker to path as ${{ inputs.command-name }}" | ||
echo "::add-path::$(pwd)" | ||
shell: bash |