Skip to content

Precheck fail on old builtin #3

Precheck fail on old builtin

Precheck fail on old builtin #3

Workflow file for this run

name: Disallow use of old builtin repository
on:
pull_request:
jobs:
# Ensure no changes involve the old builtin repository directory
check-builtin-dir:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Get changed files
id: changed-files
run: |

Check failure on line 16 in .github/workflows/builtin-check.yml

View workflow run for this annotation

GitHub Actions / Disallow use of old builtin repository

Invalid workflow file

The workflow is not valid. .github/workflows/builtin-check.yml (Line: 16, Col: 12): Unrecognized named-value: 'githhub'. Located at position 1 within expression: githhub.event.commits[0].id
case '${{ github.even_name }}' in
push)
first='${{ githhub.event.commits[0].id }}'
last='${{ githhub.event.commits[-1].id }}'
;;
pull_request)
first='${{ githhub.event.base_ref }}'
last='${{ githhub.event.head_ref }}'
;;
esac
changed_files=$(git diff --name-only --diff-filter=d "${first}~1" "${last}")
echo "Changed files:"
for file in ${{ changed_files }}; do
echo $file
done
OLD_BUILTIN="var/spack/repos/spack_repo/builtin"
NEW_BUILTIN="repos/spack_repo/builtin"
have_old_repo=$(echo $changed_files | grep -q ${OLD_BUILTIN})
if ${{ have_old_repo }}; then
echo "Error: Packages are not allowed in $OLD_BUILTIN."
echo " Use $NEW_BUILTIN instead."
exit 1
else
echo "$OLD_BUILTIN is not being used"
fi