Precheck fail on old builtin #3
Workflow file for this run
This file contains hidden or 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
| 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
|
||
| 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 | ||