The `check-whitespace` CI job is only available as a GitHub action. To help enable this job with other CI providers, first separate the logic performing the whitespace check into its own script. In subsequent commits, this script is further generalized allowing its reuse. Helped-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
33 lines
879 B
YAML
33 lines
879 B
YAML
name: check-whitespace
|
|
|
|
# Get the repository with all commits to ensure that we can analyze
|
|
# all of the commits contributed via the Pull Request.
|
|
# Process `git log --check` output to extract just the check errors.
|
|
# Exit with failure upon white-space issues.
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
|
|
# Avoid unnecessary builds. Unlike the main CI jobs, these are not
|
|
# ci-configurable (but could be).
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check-whitespace:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: git log --check
|
|
id: check_out
|
|
run: |
|
|
./ci/check-whitespace.sh \
|
|
"${{github.event.pull_request.base.sha}}" \
|
|
"$GITHUB_STEP_SUMMARY" \
|
|
"https://github.com/${{github.repository}}"
|