mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-05-17 10:25:08 +00:00
style: add editorconfig file
This commit is contained in:
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
2
LICENSE
2
LICENSE
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|||||||
12
action.yml
12
action.yml
@@ -1,9 +1,9 @@
|
|||||||
# action.yml
|
# action.yml
|
||||||
name: 'GitHub Slug'
|
name: "GitHub Slug"
|
||||||
description: 'Action to slug and expose some github variables'
|
description: "Action to slug and expose some github variables"
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: "docker"
|
||||||
image: 'Dockerfile'
|
image: "Dockerfile"
|
||||||
branding:
|
branding:
|
||||||
icon: 'crop'
|
icon: "crop"
|
||||||
color: 'orange'
|
color: "orange"
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
|
|
||||||
slug_ref() {
|
slug_ref() {
|
||||||
echo "$1" \
|
echo "$1" |
|
||||||
| tr "[:upper:]" "[:lower:]" \
|
tr "[:upper:]" "[:lower:]" |
|
||||||
| sed -r 's#refs/[^\/]*/##;s/[~\^]+//g;s/[^a-zA-Z0-9]+/-/g;s/^-+\|-+$//g;s/^-*//;s/-*$//' \
|
sed -r 's#refs/[^\/]*/##;s/[~\^]+//g;s/[^a-zA-Z0-9]+/-/g;s/^-+\|-+$//g;s/^-*//;s/-*$//' |
|
||||||
| cut -c1-63
|
cut -c1-63
|
||||||
}
|
}
|
||||||
|
|
||||||
short_sha(){
|
short_sha() {
|
||||||
echo "$1" \
|
echo "$1" |
|
||||||
| cut -c1-8
|
cut -c1-8
|
||||||
}
|
}
|
||||||
|
|
||||||
echo ::set-env name=GITHUB_REF_SLUG::"$(slug_ref "$GITHUB_REF")"
|
echo ::set-env name=GITHUB_REF_SLUG::"$(slug_ref "$GITHUB_REF")"
|
||||||
|
|||||||
@@ -33,4 +33,4 @@
|
|||||||
"@semantic-release/github"
|
"@semantic-release/github"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ test_short_sha(){
|
|||||||
actual="$(short_sha ${given})"
|
actual="$(short_sha ${given})"
|
||||||
echo "expected : [${expected}], actual : [${actual}]"
|
echo "expected : [${expected}], actual : [${actual}]"
|
||||||
[ "${actual}" == "${expected}" ]
|
[ "${actual}" == "${expected}" ]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,4 +52,4 @@ test_sluf_ref() {
|
|||||||
actual="$(slug_ref \"${given}\")"
|
actual="$(slug_ref \"${given}\")"
|
||||||
echo "expected : [${expected}], actual : [${actual}]"
|
echo "expected : [${expected}], actual : [${actual}]"
|
||||||
[ "${actual}" == "${expected}" ]
|
[ "${actual}" == "${expected}" ]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user