-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert to enable AutoCorrect again, and lint by git changed contents
- Loading branch information
Showing
2 changed files
with
61 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: AutoCorrect Lint | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "10" | ||
|
||
- name: Config git core.quotePath | ||
run: | | ||
# If you don't do this, the get-diff-action won't be able to | ||
# notice files that contain non-ascii characters. | ||
# I.e. | ||
# | ||
# ▶ git status | ||
# Changes not staged for commit: | ||
# ... | ||
# modified: "files/en-us/glossary/b\303\251zier_curve/index.html" | ||
# | ||
# But after you set `core.quotePath` you get: | ||
# | ||
# ▶ git status | ||
# Changes not staged for commit: | ||
# ... | ||
# modified: "files/en-us/glossary/bézier_curve/index.html" | ||
# | ||
# Now, this gets used by the `git diff ...` inside get-diff-action. | ||
git config --global core.quotePath false | ||
- name: Get changed files | ||
run: | | ||
GIT_DIFF_FILTERED=$(git diff --diff-filter=AM --name-only ${{ github.event.pull_request.base.sha }} -- files/zh-cn/ | tr "\n" " ") | ||
echo "GIT_DIFF_FILTERED=$GIT_DIFF_FILTERED" >> $GITHUB_ENV | ||
- name: AutoCorrect changed content | ||
if: ${{ env.GIT_DIFF_FILTERED }} | ||
uses: huacnlee/[email protected] | ||
with: | ||
args: ${{ env.GIT_DIFF_FILTERED }} --lint |
This file contains 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