3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-18 09:44:46 +00:00
changed-files/.github/workflows/test.yml

697 lines
28 KiB
YAML
Raw Normal View History

2021-03-05 02:36:52 +00:00
name: CI
on:
2021-04-23 10:14:21 +00:00
push:
branches:
- main
2021-03-05 02:36:52 +00:00
pull_request:
branches:
- main
jobs:
shellcheck:
name: Run shellcheck
2021-05-25 04:30:19 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout to branch
2022-03-01 19:50:35 +00:00
uses: actions/checkout@v3
- name: shellcheck
uses: reviewdog/action-shellcheck@v1.14
test-pull-requests-from-forks:
name: Test changed-files diff on pull_requests from forks
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
2022-03-16 05:38:55 +00:00
max-parallel: 4
matrix:
2022-03-16 06:08:10 +00:00
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
steps:
- name: Checkout
2022-03-01 19:50:35 +00:00
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- 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: ./
with:
base_sha: ${{ github.event.pull_request.base.sha }}
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files.outputs) }}'
shell:
bash
test-multiple-repositories:
name: Test with multiple repositories
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
2022-03-16 05:38:55 +00:00
max-parallel: 4
matrix:
2022-03-16 06:08:10 +00:00
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
steps:
- name: Checkout into dir1
2022-03-01 19:50:35 +00:00
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
path: dir1
- name: Run changed-files with defaults on the dir1
id: changed-files-dir1
uses: ./dir1
with:
path: dir1
- name: Show output
run: |
2021-09-04 13:08:20 +00:00
echo '${{ toJSON(steps.changed-files-dir1.outputs) }}'
shell:
bash
- name: List all modified files
run: |
for file in ${{ steps.changed-files-dir1.outputs.modified_files }}; do
2021-09-04 13:08:20 +00:00
echo "$file"
done
shell:
bash
- name: Checkout into dir2
2022-03-01 19:50:35 +00:00
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
path: dir2
- name: Run changed-files with defaults on the dir2
id: changed-files-dir2
uses: ./dir2
with:
path: dir2
- name: Show output
run: |
2021-09-04 13:08:20 +00:00
echo '${{ toJSON(steps.changed-files-dir2.outputs) }}'
shell:
bash
- name: List all modified files
run: |
for file in ${{ steps.changed-files-dir2.outputs.modified_files }}; do
2021-09-04 13:08:20 +00:00
echo "$file"
done
shell:
bash
test-non-existent-base-sha:
name: Test changed-files non existent base sha
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
2022-03-16 05:38:55 +00:00
max-parallel: 4
matrix:
2022-03-16 06:08:10 +00:00
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
2021-05-25 04:30:19 +00:00
steps:
- name: Checkout to branch
2022-03-01 19:50:35 +00:00
uses: actions/checkout@v3
- name: Run changed-files with non existent base sha
2021-05-25 04:30:19 +00:00
id: changed-files
uses: ./
2021-05-25 04:30:19 +00:00
continue-on-error: true
with:
base_sha: "4554456"
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files.outputs) }}"
shell:
bash
- name: Run changed-files-specific with non existent base sha
id: changed-files-specific
2021-05-25 04:30:19 +00:00
uses: ./
continue-on-error: true
with:
files: action.yml
base_sha: "4554456"
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-specific.outputs) }}"
shell:
bash
test-non-existent-sha:
name: Test changed-files non existent sha
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
2022-03-16 05:38:55 +00:00
max-parallel: 4
matrix:
2022-03-16 06:08:10 +00:00
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
steps:
- name: Checkout to branch
2022-03-01 19:50:35 +00:00
uses: actions/checkout@v3
- name: Run changed-files with non existent sha
id: changed-files
uses: ./
continue-on-error: true
with:
base_sha: "4554456"
2021-05-25 04:30:19 +00:00
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files.outputs) }}"
shell:
bash
- name: Run changed-files-specific with non existent sha
id: changed-files-specific
uses: ./
continue-on-error: true
with:
files: action.yml
base_sha: "4554456"
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-specific.outputs) }}"
shell:
bash
2021-05-25 04:30:19 +00:00
2021-03-05 02:36:52 +00:00
test:
name: Test changed-files
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
2022-03-16 05:38:55 +00:00
max-parallel: 4
matrix:
2022-03-16 06:08:10 +00:00
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
2021-03-05 02:36:52 +00:00
steps:
- name: Checkout
2022-03-01 19:50:35 +00:00
uses: actions/checkout@v3
2021-04-23 10:17:20 +00:00
with:
submodules: true
2021-04-23 10:17:20 +00:00
fetch-depth: 0
2021-03-05 12:28:53 +00:00
- name: Run changed-files with defaults
2021-03-05 03:36:52 +00:00
id: changed-files
2021-03-05 02:36:52 +00:00
uses: ./
2021-03-05 03:36:52 +00:00
- name: Show output
run: |
2021-09-04 13:08:20 +00:00
echo '${{ toJSON(steps.changed-files.outputs) }}'
shell:
bash
2021-03-25 23:23:19 +00:00
- name: List all modified files
2021-03-20 12:09:58 +00:00
run: |
for file in ${{ steps.changed-files.outputs.modified_files }}; do
2021-03-20 12:09:58 +00:00
echo $file
done
shell:
bash
2021-04-02 12:27:48 +00:00
- name: Run step when README.md changes
2021-04-02 13:00:06 +00:00
if: contains(steps.changed-files.outputs.modified_files, 'README.md')
2021-04-02 12:27:48 +00:00
run: |
2021-04-02 13:12:33 +00:00
echo "Your README.md has been modified ${{ steps.changed-files.outputs.modified_files }}."
shell:
bash
2021-09-04 13:08:20 +00:00
- name: Run changed-files with forward slash separator
id: changed-files-forward-slash
uses: ./
with:
separator: "/"
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-forward-slash.outputs) }}'
shell:
bash
- name: Run changed-files with newline separator
id: changed-files-newline
uses: ./
with:
separator: "\n"
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-newline.outputs) }}'
shell:
bash
2021-09-04 13:08:20 +00:00
- name: Run changed-files with pipe separator
id: changed-files-pipe
uses: ./
with:
separator: "|"
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-pipe.outputs) }}'
shell:
bash
2021-03-05 12:28:53 +00:00
- name: Run changed-files with comma separator
id: changed-files-comma
uses: ./
with:
separator: ","
- name: Show output
run: |
2021-09-04 13:08:20 +00:00
echo '${{ toJSON(steps.changed-files-comma.outputs) }}'
shell:
bash
- name: Run changed-files with specific files from a source file using a newline separator
id: changed-files-specific-newline-source-file
uses: ./
with:
files_from_source_file: |
test/changed-files-list.txt
separator: "\n"
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-specific-newline-source-file.outputs) }}'
shell:
bash
2021-05-01 11:55:01 +00:00
- name: Run changed-files with specific files
id: changed-files-specific
uses: ./
with:
files: |
.github/workflows/test.yml
2021-05-01 23:58:35 +00:00
action.yml
**/test.txt
files_ignore: |
test/test/test.txt
2021-09-04 13:08:20 +00:00
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-specific.outputs) }}'
shell:
bash
- name: Check if a excluded file is not included in any_changed
if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test/test.txt')"
run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})"
exit 1
shell:
bash
- name: Verify any_changed for specific files
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test.txt')"
2021-05-16 20:26:22 +00:00
run: |
2021-05-17 08:19:10 +00:00
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})"
2021-05-16 20:26:22 +00:00
exit 1
fi
shell:
bash
- name: Check if a excluded file is not included in any_modified
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test/test.txt')"
run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})"
exit 1
shell:
bash
- name: Verify any_modified for specific files
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test.txt')"
run: |
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Check if a excluded file is not included in any_deleted
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test/test/test.txt')"
run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})"
exit 1
shell:
bash
- name: Verify any_deleted for specific files
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test/test.txt')"
run: |
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})"
exit 1
fi
shell:
bash
2021-08-06 10:14:50 +00:00
- name: Run changed-files with specific files comma check duplicates
id: changed-files-specific-duplicate-output
uses: ./
with:
files: |
entrypoint.sh
*.sh
- name: Verify all_changed_files files has no duplicates
if: contains(steps.changed-files-specific-duplicate-output.outputs.all_changed_files, 'entrypoint.sh')
2021-08-06 10:14:50 +00:00
run: |
ALL_CHANGED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_changed_files }})
UNIQUE_ALL_CHANGED_FILES=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | sort -u | xargs)
if [[ "$ALL_CHANGED_FILES[@]" != "$UNIQUE_ALL_CHANGED_FILES[@]" ]]; then
echo "Duplicate output: Expected "$UNIQUE_ALL_CHANGED_FILES" got $ALL_CHANGED_FILES"
exit 1
fi
shell:
bash
- name: Verify all_changed_and_modified_files files has no duplicates
if: contains(steps.changed-files-specific-duplicate-output.outputs.all_changed_and_modified_files, 'entrypoint.sh')
run: |
ALL_CHANGED_AND_MODIFIED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_changed_and_modified_files }})
UNIQUE_ALL_CHANGED_AND_MODIFIED_FILES=$(echo "$ALL_CHANGED_AND_MODIFIED_FILES" | tr ' ' '\n' | sort -u | xargs)
2021-08-06 10:14:50 +00:00
if [[ "$ALL_CHANGED_AND_MODIFIED_FILES[@]" != "$UNIQUE_ALL_CHANGED_AND_MODIFIED_FILES[@]" ]]; then
echo "Duplicate output: Expected "$UNIQUE_ALL_CHANGED_AND_MODIFIED_FILES" got $ALL_CHANGED_AND_MODIFIED_FILES"
2021-08-06 10:14:50 +00:00
exit 1
fi
shell:
bash
- name: Verify all_modified_files files has no duplicates
if: contains(steps.changed-files-specific-duplicate-output.outputs.all_modified_files, 'entrypoint.sh')
run: |
ALL_MODIFIED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_modified_files }})
UNIQUE_ALL_MODIFIED_FILES=$(echo "$ALL_MODIFIED_FILES" | tr ' ' '\n' | sort -u | xargs)
if [[ "$ALL_MODIFIED_FILES[@]" != "$UNIQUE_ALL_MODIFIED_FILES[@]" ]]; then
echo "Duplicate output: Expected "$UNIQUE_ALL_MODIFIED_FILES" got $ALL_MODIFIED_FILES"
exit 1
fi
shell:
bash
2021-05-01 12:59:18 +00:00
- name: Run changed-files with specific files comma separator
id: changed-files-specific-comma
uses: ./
with:
files: |
.github/workflows/test.yml
2021-05-01 23:58:35 +00:00
action.yml
2021-05-01 12:59:18 +00:00
separator: ","
2021-09-04 13:08:20 +00:00
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-specific-comma.outputs) }}'
shell:
bash
- name: Verify any_changed files comma separator
if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github/workflows/test.yml')"
2021-09-04 13:08:20 +00:00
run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})"
exit 1
fi
shell:
bash
- name: Verify any_modified files comma separator
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github/workflows/test.yml')"
run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files comma separator
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github/workflows/test.yml')"
run: |
if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})"
exit 1
fi
shell:
bash
2021-09-04 13:08:20 +00:00
- name: Run changed-files with specific files pipe separator
id: changed-files-specific-pipe
uses: ./
with:
files: |
Add support for using github's glob pattern syntax (#304) * Add support for using github's glob pattern syntax Fixes: #264 #265 * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update sourcefiles.sh * Update sourcefiles.sh * Update action.yml * Update action.yml * Update action.yml * Update action.yml * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update action.yml * Update test.yml * Update changed-files-list.txt * Update changed-files-list.txt * Update action.yml * Update action.yml * Update entrypoint.sh * Update test.yml * Update README.md * Update test.yml * Update entrypoint.sh * Update test.yml Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-05 02:38:03 +00:00
**/test.yml
2021-09-04 13:08:20 +00:00
action.yml
separator: "|"
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-specific-pipe.outputs) }}'
shell:
bash
- name: Verify any_changed files comma separator
if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github/workflows/test.yml')"
2021-09-04 13:08:20 +00:00
run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})"
exit 1
fi
shell:
bash
- name: Verify any_modified files comma separator
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github/workflows/test.yml')"
run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files comma separator
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github/workflows/test.yml')"
run: |
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})"
exit 1
fi
shell:
bash
2021-09-04 13:08:20 +00:00
- name: Run changed-files with specific files forward slash separator
id: changed-files-specific-forward-slash
uses: ./
with:
files: |
.github/workflows/test.yml
action.yml
separator: "/"
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-specific-forward-slash.outputs) }}'
shell:
bash
- 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-forward-slash.outputs.any_changed }}" != "false" ]]; then
2021-09-04 13:08:20 +00:00
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 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-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 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-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
shell:
bash
- name: Run changed-files with specific files from a source file
id: changed-files-specific-source-file
uses: ./
with:
files_from_source_file: |
test/changed-files-list.txt
test/changed-files-list.txt
files: |
**/workflows/greetings.yml
- name: Check if a excluded file is not included in any_changed
if: contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test/test.txt')
run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})"
exit 1
shell:
bash
- name: Verify any_changed from source files
2021-10-15 17:36:09 +00:00
if: |
(
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'action.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test.txt')
2021-10-15 17:36:09 +00:00
)
run: |
2021-09-04 13:08:20 +00:00
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-source-file.outputs.any_changed }})"
exit 1
fi
shell:
bash
- name: Check if a excluded file is not included in any_modified
if: contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test/test.txt')
run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})"
exit 1
shell:
bash
- name: Verify any_modified from source files
if: |
(
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/test.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml') &&
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test.txt')
)
run: |
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-source-file.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Check if a excluded file is not included in any_deleted
if: contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test/test.txt')
run: |
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})"
exit 1
shell:
bash
- name: Verify any_deleted from source files
if: "!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test.txt')"
run: |
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-source-file.outputs.any_deleted }})"
exit 1
fi
shell:
bash
- name: Show output
run: |
2021-09-04 13:08:20 +00:00
echo '${{ toJSON(steps.changed-files-specific-source-file.outputs) }}'
shell:
bash
- name: Run changed-files with specific files from a source file using a comma separator
id: changed-files-specific-comma-source-file
uses: ./
with:
files_from_source_file: |
test/changed-files-list.txt
separator: ","
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-specific-comma-source-file.outputs) }}'
shell:
bash
- name: Verify any_changed files comma separator
if: "!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'test/test.txt')"
run: |
2021-09-04 13:08:20 +00:00
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }})"
exit 1
fi
shell:
bash
- name: Verify any_modified files comma separator
if: "!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'test/test.txt')"
run: |
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }})"
exit 1
fi
shell:
bash
- name: Verify any_deleted files with comma separator
if: "!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, 'test/test.txt')"
2021-05-01 12:59:18 +00:00
run: |
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }})"
exit 1
fi
shell:
bash
- name: Run changed-files with custom sha
id: changed-files-custom-sha
uses: ./
with:
sha: ${{ github.event.pull_request.head.sha }}
- name: Show output
run: |
2021-09-04 13:08:20 +00:00
echo '${{ toJSON(steps.changed-files-custom-sha.outputs) }}'
shell:
bash
- name: Run changed-files with since_last_remote_commit set to true
id: changed-files-since-last-remote-commit
uses: ./
with:
since_last_remote_commit: 'true'
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-since-last-remote-commit.outputs) }}'
shell:
bash
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5
if: github.event_name == 'pull_request'
- uses: nrwl/last-successful-commit-action@v1
id: last_successful_commit
if: github.event_name == 'pull_request'
with:
branch: ${{ steps.branch-name.outputs.base_ref_branch }}
workflow_id: 'test.yml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run changed-files with a custom base sha
if: github.event_name == 'pull_request'
id: changed-files-custom-base-sha
uses: ./
with:
base_sha: ${{ steps.last_successful_commit.outputs.commit_hash }}
- name: Show output
if: github.event_name == 'pull_request'
run: |
2021-09-04 13:08:20 +00:00
echo '${{ toJSON(steps.changed-files-custom-base-sha.outputs) }}'
shell:
bash
- name: Run changed-files with specific files (only-changed)
id: changed-files-specific-only-changed
uses: ./
with:
files: |
Add support for using github's glob pattern syntax (#304) * Add support for using github's glob pattern syntax Fixes: #264 #265 * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update sourcefiles.sh * Update sourcefiles.sh * Update action.yml * Update action.yml * Update action.yml * Update action.yml * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update sourcefiles.sh * Update action.yml * Update test.yml * Update changed-files-list.txt * Update changed-files-list.txt * Update action.yml * Update action.yml * Update entrypoint.sh * Update test.yml * Update README.md * Update test.yml * Update entrypoint.sh * Update test.yml Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-05 02:38:03 +00:00
.github/**/test.yml
- name: Verify only_changed files
if: steps.changed-files-specific-only-changed.outputs.other_changed_files != ''
run: |
if [[ "${{ steps.changed-files-specific-only-changed.outputs.only_changed }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-only-changed.outputs.only_changed }})"
exit 1
fi
shell:
bash
- name: Verify only_deleted files
if: steps.changed-files-specific-only-changed.outputs.other_deleted_files != ''
run: |
if [[ "${{ steps.changed-files-specific-only-changed.outputs.only_deleted }}" != "false" ]]; then
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-only-changed.outputs.only_deleted }})."
exit 1
fi
shell:
bash
- name: Show output
run: |
2021-09-04 13:08:20 +00:00
echo '${{ toJSON(steps.changed-files-specific-only-changed.outputs) }}'
shell:
bash