<NME> test-pr.yml
<BEF> name: Test PR

on:
  pull_request:

defaults:
  run:
    shell: 'bash -Eeuo pipefail -x {0}'

jobs:

  naughty:
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
  contents: read

jobs:

  naughty:
    name: Naughty
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Check for Common Issues
        run: |
          bashbrewVersion="$(< bashbrew-version)"
          git clone --depth 1 https://github.com/docker-library/bashbrew.git -b "v$bashbrewVersion" ~/bashbrew
          ~/bashbrew/bashbrew.sh --version > /dev/null
          export PATH="$HOME/bashbrew/bin:$PATH"
          bashbrew --version
          .github/workflows/naughty.sh

  generate-jobs:
    name: Generate Jobs
    runs-on: ubuntu-latest
    outputs:
      strategy: ${{ steps.generate-jobs.outputs.strategy }}
      length: ${{ steps.generate-jobs.outputs.length }}
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - id: generate-jobs
        name: Generate Jobs
        run: |
          bashbrewVersion="$(< bashbrew-version)"
          git clone --depth 1 https://github.com/docker-library/bashbrew.git -b "v$bashbrewVersion" ~/bashbrew
          strategy="$(.github/workflows/generate.sh ~/bashbrew)"
          jq . <<<"$strategy" # sanity check / debugging aid
          echo "::set-output name=strategy::$strategy"
          length="$(jq <<<"$strategy" -r '.matrix.include | length')"
          echo "::set-output name=length::$length"

  test:
    needs: generate-jobs
    strategy: ${{ fromJSON(needs.generate-jobs.outputs.strategy) }}
    if: needs.generate-jobs.outputs.length > 0
    name: ${{ matrix.name }}
    runs-on: ${{ matrix.os }}
    steps:
      - name: Prepare Git
        run: |
          # enable symlinks on Windows (https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks)
          git config --global core.symlinks true
          # also, make sure Windows symlinks are *real* symlinks (https://github.com/git-for-windows/git/pull/156)
          echo 'MSYS=winsymlinks:nativestrict' >> "$GITHUB_ENV"
          # https://github.com/docker-library/bashbrew/blob/a40a54d4d81b9fd2e39b4d7ba3fe203e8b022a67/scripts/github-actions/generate.sh#L146-L149
        if: runner.os == 'Windows'
      - uses: actions/checkout@v2
      - name: Prepare Environment
        run: ${{ matrix.runs.prepare }}
      - name: Pull Dependencies
        run: ${{ matrix.runs.pull }}
      - name: Build ${{ matrix.name }}
        run: ${{ matrix.runs.build }}
      - name: History ${{ matrix.name }}
        run: ${{ matrix.runs.history }}
      - name: Test ${{ matrix.name }}
        run: ${{ matrix.runs.test }}
      - name: '"docker images"'
        run: ${{ matrix.runs.images }}

<MSG> Set "GIT_LFS_SKIP_SMUDGE" in both GitHub Actions to prevent LFS from breaking diff/test

See https://github.com/docker-library/bashbrew/issues/10 for details and https://github.com/docker-library/official-images/pull/8282 for the PR which failed and caused us to notice. 😅

<DFF> @@ -7,6 +7,10 @@ defaults:
   run:
     shell: 'bash -Eeuo pipefail -x {0}'
 
+env:
+  # https://github.com/docker-library/bashbrew/issues/10
+  GIT_LFS_SKIP_SMUDGE: 1
+
 jobs:
 
   naughty:

Set "GIT_LFS_SKIP_SMUDGE" in both GitHub Actions to prevent LFS from breaking diff/test