Merge pull request #687 from WaterLemons2k/composite

feat(ci): Use composite to run action
This commit is contained in:
Ed Page 2023-03-14 10:40:59 -05:00 committed by GitHub
commit d58df3464d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 17 deletions

View file

@ -30,8 +30,18 @@ inputs:
required: false required: false
runs: runs:
using: "docker" using: 'composite'
image: "docker/Dockerfile" 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: branding:
icon: "link" icon: "link"

View file

@ -30,10 +30,12 @@ if [[ -z $(ls ${TARGET} 2>/dev/null) ]]; then
exit 1 exit 1
fi fi
if [[ -z $(which ${CMD_NAME} 2>/dev/null) ]]; then if [[ -z $(which ${CMD_NAME} 2>/dev/null) ]]; then
log "ERROR: 'typos' not found" VERSION=1.13.22
exit 1 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 fi
log "typos: $(typos --version)"
log "jq: $(jq --version)" log "jq: $(jq --version)"
ARGS="${TARGET}" ARGS="${TARGET}"

View file

@ -25,7 +25,7 @@ pre-release-replacements = [
{file="../../CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, {file="../../CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1},
{file="../../CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1}, {file="../../CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1},
{file="../../CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/crate-ci/typos/compare/{{tag_name}}...HEAD", exactly=1}, {file="../../CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\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="../../docs/pre-commit.md", search="rev: .*", replace="rev: {{tag_name}}", exactly=1},
{file="../../setup.py", search="TYPOS_VERSION = .*", replace="TYPOS_VERSION = '{{version}}'", exactly=1}, {file="../../setup.py", search="TYPOS_VERSION = .*", replace="TYPOS_VERSION = '{{version}}'", exactly=1},
] ]

View file

@ -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"]