feat: enhance error handling for non-git directories (#1885)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2024-01-25 11:46:48 -07:00
committed by GitHub
parent 2cb2c9234e
commit 90a06d6ba9
5 changed files with 45 additions and 5 deletions

View File

@@ -550,6 +550,39 @@ jobs:
shell:
bash
test-non-existing-repository:
name: Test changed-files with non existing repository
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && needs.build.outputs.files_changed != 'true'
permissions:
pull-requests: read
steps:
- name: Checkout into dir1
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
fetch-depth: 0
path: dir1
- name: Download build assets
uses: actions/download-artifact@v3
with:
name: build-assets
path: dir1/dist
- name: Run changed-files with non existing repository
id: changed-files
continue-on-error: true
uses: ./dir1
- name: Verify failed
if: steps.changed-files.outcome != 'failure'
run: |
echo "Expected: (failure) got ${{ steps.changed-files.outcome }}"
exit 1
test-submodules:
name: Test changed-files with submodule
runs-on: ubuntu-latest