Last active
January 27, 2019 13:52
-
-
Save masutaka/6bb0d4c2d33818be8d03ffb60ef84c6e to your computer and use it in GitHub Desktop.
A sample files of GitHub Actions
This file contains hidden or 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
.github | |
├── hadolint | |
│ ├── Dockerfile (hadolint_Dockerfile) | |
│ └── entrypoint.sh (hadolint_entrypoint.sh) | |
├── main.workflow (01main.workflow) | |
└── shellcheck | |
├── Dockerfile (shellcheck_Dockerfile) | |
└── entrypoint.sh (shellcheck_entrypoint.sh) |
This file contains hidden or 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
workflow "masutaka.net" { | |
on = "push" | |
resolves = ["hadolint", "shellcheck"] | |
} | |
action "hadolint" { | |
uses = "./.github/hadolint" | |
args = ["Dockerfile*", ".github/**/Dockerfile"] | |
} | |
action "shellcheck" { | |
uses = "./.github/shellcheck" | |
args = ["script/*", ".github/**/entrypoint.sh"] | |
} |
This file contains hidden or 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
FROM alpine:3.8 | |
LABEL "com.github.actions.icon"="target" | |
LABEL "com.github.actions.color"="blue" | |
RUN apk add --no-cache --no-progress curl=7.61.1-r1 | |
ENV HADOLINT_VERSION=v1.15.0 \ | |
HADOLINT_PATH=/usr/local/bin/hadolint | |
RUN curl -sLo $HADOLINT_PATH https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-Linux-x86_64 && \ | |
chmod 500 $HADOLINT_PATH | |
COPY entrypoint.sh /entrypoint.sh | |
ENTRYPOINT ["/entrypoint.sh"] |
This file contains hidden or 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
#!/bin/sh -eux | |
# shellcheck disable=SC2068 | |
hadolint -v | |
hadolint $@ |
This file contains hidden or 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
FROM alpine:3.8 | |
LABEL "com.github.actions.icon"="terminal" | |
LABEL "com.github.actions.color"="purple" | |
RUN apk add --no-cache --no-progress curl=7.61.1-r1 | |
ENV SHELLCHECK_VERSION=v0.6.0 | |
WORKDIR /usr/local/bin | |
SHELL ["/bin/ash", "-o", "pipefail", "-c"] | |
RUN curl -s https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz | \ | |
tar xvJf - --strip-components=1 shellcheck-${SHELLCHECK_VERSION}/shellcheck | |
WORKDIR / | |
COPY entrypoint.sh /entrypoint.sh | |
ENTRYPOINT ["/entrypoint.sh"] |
This file contains hidden or 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
#!/bin/sh -eux | |
# shellcheck disable=SC2068 | |
shellcheck -V | |
shellcheck $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment