feat: Added support for using fork point to detect file changes. (#384)
* feat: Added support for using fork point to detect file changes. * Updated README.md * Updated test.yml * Updated action.yml * Updated diff-sha.sh * Updated diff-sha.sh * Updated diff-sha.sh * Updated diff-sha.sh * Updated diff-sha.sh * Updated README.md * Updated test file * Updated test.yml * Updated test.yml * Removed unused code. * Removed unused code. * Test using head_ref * Test using head * Removed unused code.
This commit is contained in:
28
.github/workflows/test.yml
vendored
28
.github/workflows/test.yml
vendored
@@ -20,8 +20,8 @@ jobs:
|
||||
- name: shellcheck
|
||||
uses: reviewdog/action-shellcheck@v1.14
|
||||
|
||||
test-pull-requests-diff:
|
||||
name: Test changed-files diff on pull_requests
|
||||
test-pull-requests-from-forks:
|
||||
name: Test changed-files diff on pull_requests from forks
|
||||
runs-on: ${{ matrix.platform }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -40,6 +40,18 @@ jobs:
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Get changed files use_fork_point
|
||||
id: changed-files-fork-point
|
||||
uses: ./
|
||||
with:
|
||||
use_fork_point: "true"
|
||||
|
||||
- name: Show output
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files-fork-point.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: ./
|
||||
@@ -446,28 +458,28 @@ jobs:
|
||||
echo '${{ toJSON(steps.changed-files-specific-forward-slash.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed files comma separator
|
||||
- name: Verify any_changed files forward slash separator
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator
|
||||
- name: Verify any_modified files forward slash separator
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator
|
||||
- name: Verify any_deleted files forward slash separator
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user