Skip to content

Commit

Permalink
Merge branch 'git:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
RebelTat authored Jul 31, 2021
2 parents 3bdf62f + 940fe20 commit a0c4155
Show file tree
Hide file tree
Showing 1,794 changed files with 294,546 additions and 149,543 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.pm eol=lf diff=perl
*.py eol=lf diff=python
*.bat eol=crlf
CODE_OF_CONDUCT.md -whitespace
/Documentation/**/*.txt eol=lf
/command-list.txt eol=lf
/GIT-VERSION-GEN eol=lf
Expand Down
3 changes: 3 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ If you prefer video, then [this talk](https://www.youtube.com/watch?v=Q7i_qQW__q
might be useful to you as the presenter walks you through the contribution
process by example.

Or, you can follow the ["My First Contribution"](https://git-scm.com/docs/MyFirstContribution)
tutorial for another example of the contribution process.

Your friendly Git community!
71 changes: 71 additions & 0 deletions .github/workflows/check-whitespace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: check-whitespace

# Get the repo with the commits(+1) in the series.
# Process `git log --check` output to extract just the check errors.
# Add a comment to the pull request with the check errors.

on:
pull_request:
types: [opened, synchronize]

jobs:
check-whitespace:
runs-on: ubuntu-latest
steps:
- name: Set commit count
shell: bash
run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV
env:
COMMITS: ${{ github.event.pull_request.commits }}

- uses: actions/checkout@v2
with:
fetch-depth: ${{ env.COMMIT_DEPTH }}

- name: git log --check
id: check_out
run: |
log=
commit=
while read dash etc
do
case "${dash}" in
"---")
commit="${etc}"
;;
"")
;;
*)
if test -n "${commit}"
then
log="${log}\n${commit}"
echo ""
echo "--- ${commit}"
fi
commit=
log="${log}\n${dash} ${etc}"
echo "${dash} ${etc}"
;;
esac
done <<< $(git log --check --pretty=format:"---% h% s" -${{github.event.pull_request.commits}})
if test -n "${log}"
then
echo "::set-output name=checkout::"${log}""
exit 2
fi
- name: Add Check Output as Comment
uses: actions/github-script@v3
id: add-comment
env:
log: ${{ steps.check_out.outputs.checkout }}
with:
script: |
await github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Whitespace errors found in workflow ${{ github.workflow }}:\n\n\`\`\`\n${process.env.log.replace(/\\n/g, "\n")}\n\`\`\``
})
if: ${{ failure() }}
Loading

0 comments on commit a0c4155

Please sign in to comment.