Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,51 @@ jobs:
shell:
bash

test-rest-api-push:
name: Test changed-files with REST API on push event (no .git)
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps:
# Checkout is only needed to get action.yml on disk for the runner.
# We remove .git afterward to prove the action works purely via API.
- name: Checkout action definition only
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: dir1
sparse-checkout: |
action.yml
sparse-checkout-cone-mode: false

- name: Remove .git to prove no local git is needed
run: rm -rf dir1/.git
shell: bash

- name: Download build assets
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-assets
path: dir1/dist

- name: Run changed-files with REST API on push
id: changed-files
uses: ./dir1
with:
use_rest_api: true

- name: Verify output is not empty
run: |
echo '${{ toJSON(steps.changed-files.outputs) }}'
if [ -z "${{ steps.changed-files.outputs.all_changed_files }}" ]; then
echo "::warning::No changed files detected (may be expected for some pushes)"
else
echo "Changed files detected successfully via REST API on push event"
fi
shell:
bash

test-dir-names-nested-folder:
name: Test changed-files with dir-names in a nested folder
runs-on: ubuntu-latest
Expand Down
Loading