feat: add support for retrieving changed files via github rest api (#1289)
Co-authored-by: GitHub Action <action@github.com> Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com> Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
39
.github/workflows/test.yml
vendored
39
.github/workflows/test.yml
vendored
@@ -132,6 +132,7 @@ jobs:
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-assets
|
||||
path: dir1/dist
|
||||
|
||||
- name: Run changed-files with defaults on the dir1
|
||||
id: changed-files-dir1
|
||||
@@ -153,6 +154,12 @@ jobs:
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Download build assets
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-assets
|
||||
path: dir2/dist
|
||||
|
||||
- name: Checkout into dir2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -508,6 +515,38 @@ jobs:
|
||||
echo "Expected: (failure) got ${{ steps.changed-files-specific.outcome }}"
|
||||
exit 1
|
||||
|
||||
test-rest-api:
|
||||
name: Test changed-files with REST API
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.event_name != 'push'
|
||||
permissions:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: Checkout into dir1
|
||||
uses: actions/checkout@v3
|
||||
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 REST API
|
||||
id: changed-files
|
||||
uses: ./dir1
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
|
||||
test-submodules:
|
||||
name: Test changed-files with submodule
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user