diff --git a/action.yml b/action.yml index a36d493..e6dfc61 100644 --- a/action.yml +++ b/action.yml @@ -30,8 +30,18 @@ inputs: required: false runs: - using: "docker" - image: "docker/Dockerfile" + using: 'composite' + steps: + - id: typos + run: $GITHUB_ACTION_PATH/action/entrypoint.sh + shell: bash + env: + INPUT_FILES: ${{ inputs.files }} + INPUT_EXTEND_IDENTIFIERS: ${{ inputs.extend_identifiers }} + INPUT_EXTEND_WORDS: ${{ inputs.extend_words }} + INPUT_ISOLATED: ${{ inputs.isolated }} + INPUT_WRITE_CHANGES: ${{ inputs.write_changes }} + INPUT_CONFIG: ${{ inputs.config }} branding: icon: "link" diff --git a/docker/entrypoint.sh b/action/entrypoint.sh similarity index 81% rename from docker/entrypoint.sh rename to action/entrypoint.sh index 0fddde7..23477c4 100755 --- a/docker/entrypoint.sh +++ b/action/entrypoint.sh @@ -30,10 +30,12 @@ if [[ -z $(ls ${TARGET} 2>/dev/null) ]]; then exit 1 fi if [[ -z $(which ${CMD_NAME} 2>/dev/null) ]]; then - log "ERROR: 'typos' not found" - exit 1 + VERSION=1.13.22 + log "Downloading 'typos' v${VERSION}" + wget https://github.com/crate-ci/typos/releases/download/v${VERSION}/typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz + sudo tar -xzvf typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz -C /usr/local/bin ./typos + rm typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz fi -log "typos: $(typos --version)" log "jq: $(jq --version)" ARGS="${TARGET}" diff --git a/docker/format_gh.sh b/action/format_gh.sh similarity index 100% rename from docker/format_gh.sh rename to action/format_gh.sh diff --git a/crates/typos-cli/Cargo.toml b/crates/typos-cli/Cargo.toml index b4239db..164b82f 100644 --- a/crates/typos-cli/Cargo.toml +++ b/crates/typos-cli/Cargo.toml @@ -25,7 +25,7 @@ pre-release-replacements = [ {file="../../CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, {file="../../CHANGELOG.md", search="", replace="\n## [Unreleased] - ReleaseDate\n", exactly=1}, {file="../../CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/crate-ci/typos/compare/{{tag_name}}...HEAD", exactly=1}, - {file="../../docker/Dockerfile", search="ARG VERSION=.*", replace="ARG VERSION={{version}}", min=1}, + {file="../../action/entrypoint.sh", search="VERSION=.*", replace="VERSION={{version}}", min=1}, {file="../../docs/pre-commit.md", search="rev: .*", replace="rev: {{tag_name}}", exactly=1}, {file="../../setup.py", search="TYPOS_VERSION = .*", replace="TYPOS_VERSION = '{{version}}'", exactly=1}, ] diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 2e1eec0..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:22.04 -ARG VERSION=1.13.22 -ENV VERSION=${VERSION} -RUN apt-get update && apt-get install -y wget git jq -RUN wget https://github.com/crate-ci/typos/releases/download/v${VERSION}/typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz && \ - tar -xzvf typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz && \ - mv typos /usr/local/bin -COPY entrypoint.sh /entrypoint.sh -COPY format_gh.sh /format_gh.sh -WORKDIR /github/workspace -ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]