Composer diff #644
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow | |
name: "Spelling" | |
# I take care of your fat fingers and ESL mistakes. | |
on: # yamllint disable-line rule:truthy | |
pull_request: null | |
push: | |
branches: | |
- "master" | |
workflow_call: null | |
permissions: {} # yamllint disable-line rule:braces | |
#permissions: "read-all" | |
#permissions: | |
# contents: "read" # Private repositories need read permission | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
typos_check: | |
name: "文A Typos" | |
runs-on: "ubuntu-22.04" | |
timeout-minutes: 1 | |
steps: | |
- | |
name: "Checkout repository" | |
uses: "actions/[email protected]" | |
- | |
name: "Search for misspellings" | |
#uses: "crate-ci/[email protected]" | |
env: | |
GH_TOKEN: "${{ github.token }}" | |
# yamllint disable rule:line-length | |
run: | | |
set -o pipefail | |
mkdir -p "${{ runner.temp }}/typos" | |
gh release download --repo crate-ci/typos --pattern "typos-*-x86_64-unknown-linux-musl.tar.gz" --output - \ | |
| tar -xz -C "${{ runner.temp }}/typos" ./typos | |
"${{ runner.temp }}/typos/typos" --version | |
git grep --files-with-matches --null -I -e '.' \ | |
| xargs --null --verbose -- "${{ runner.temp }}/typos/typos" --format json \ | |
| jq --raw-output '"::warning file=\(.path),line=\(.line_num),col=\(.byte_offset)::\"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")' |