diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index e9fb31f3db1..00000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 2 -updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 - versioning-strategy: widen - labels: - - "merge when passing" -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 - labels: - - "merge when passing" -- package-ecosystem: gitsubmodule - directory: / - schedule: - interval: daily - open-pull-requests-limit: 10 - labels: - - "merge when passing" diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml deleted file mode 100644 index e02d33e27f0..00000000000 --- a/.github/workflows/codacy-analysis.yml +++ /dev/null @@ -1,56 +0,0 @@ -# This workflow checks out code, performs a Codacy security scan -# and integrates the results with the -# GitHub Advanced Security code scanning feature. For more information on -# the Codacy security scan action usage and parameters, see -# https://github.com/codacy/codacy-analysis-cli-action. -# For more information on Codacy Analysis CLI in general, see -# https://github.com/codacy/codacy-analysis-cli. - -name: Codacy Security Scan - -on: - push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '15 16 * * 2' - -permissions: - actions: read - contents: read - security-events: write - -jobs: - codacy-security-scan: - name: Codacy Security Scan - runs-on: ubuntu-latest - steps: - # Checkout the repository to the GitHub Actions runner - - name: Checkout code - uses: actions/checkout@v4 - - # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - - name: Run Codacy Analysis CLI - continue-on-error: true - uses: codacy/codacy-analysis-cli-action@v4.4.5 - with: - # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository - # You can also omit the token and run the tools that support default configurations - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - verbose: true - output: results.sarif - format: sarif - # Adjust severity of non-security issues - gh-code-scanning-compat: true - # Force 0 exit code to allow SARIF file generation - # This will hand over control about PR rejection to the GitHub side - max-allowed-issues: 2147483647 - - # Upload the SARIF file generated in the previous step - - name: Upload SARIF results file - continue-on-error: true - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 3de65469773..00000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,79 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '44 20 * * 0' - -permissions: - actions: read - contents: read - security-events: write - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index 1ece94f9b05..00000000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Greetings - -on: [pull_request_target, issues] - -permissions: - pull-requests: write - issues: write - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - continue-on-error: true - with: - repo-token: ${{ secrets.PAT_TOKEN }} - issue-message: "Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience." - pr-message: "Thanks for implementing a fix, could you ensure that the test covers your changes if applicable." diff --git a/.github/workflows/issue-comment-job-example.yml b/.github/workflows/issue-comment-job-example.yml deleted file mode 100644 index 452d1df14a3..00000000000 --- a/.github/workflows/issue-comment-job-example.yml +++ /dev/null @@ -1,178 +0,0 @@ -name: Issue Comment Job Example - -permissions: - contents: read - -on: - issue_comment: - -jobs: - pr_commented: - # This job only runs for pull request comments - name: PR comment - if: ${{ github.event.issue.pull_request }} - runs-on: ubuntu-latest - steps: - - run: | - echo A comment on PR $NUMBER - env: - NUMBER: ${{ github.event.issue.number }} - - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - - name: Run changed-files with defaults - id: changed-files - uses: ./ - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - shell: - bash - - - name: Run changed-files for old new filenames test rename - id: changed-files-all-old-new-renamed-files - uses: ./ - with: - base_sha: d1c0ee4 - sha: 4d04215 - fetch_depth: 60000 - include_all_old_new_renamed_files: true - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files.outputs) }}' - shell: - bash - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files.outputs) }}' - shell: - bash - - - name: Check all_old_new_renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - - name: Check all_old_new_renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files.outputs.all_old_new_renamed_files, 'test\\test rename 1.txt,test\\test rename-1.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename 1.txt,test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - - name: Check the renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files.outputs.renamed_files, 'test/test rename-1.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files.outputs.renamed_files }})" - exit 1 - shell: - bash - - - name: Check the renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files.outputs.renamed_files, 'test\\test rename-1.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files.outputs.renamed_files }})" - exit 1 - shell: - bash - - issue_commented: - # This job only runs for issue comments - name: Issue comment - if: ${{ !github.event.issue.pull_request }} - runs-on: ubuntu-latest - steps: - - run: | - echo A comment on issue $NUMBER - env: - NUMBER: ${{ github.event.issue.number }} - - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - - name: Run changed-files with defaults - id: changed-files - uses: ./ - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - shell: - bash - - - name: Run changed-files for old new filenames test rename - id: changed-files-all-old-new-renamed-files - uses: ./ - with: - base_sha: d1c0ee4 - sha: 4d04215 - fetch_depth: 60000 - include_all_old_new_renamed_files: true - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files.outputs) }}' - shell: - bash - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files.outputs) }}' - shell: - bash - - - name: Check all_old_new_renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - - name: Check all_old_new_renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files.outputs.all_old_new_renamed_files, 'test\\test rename 1.txt,test\\test rename-1.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename 1.txt,test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - - name: Check the renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files.outputs.renamed_files, 'test/test rename-1.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files.outputs.renamed_files }})" - exit 1 - shell: - bash - - - name: Check the renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files.outputs.renamed_files, 'test\\test rename-1.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files.outputs.renamed_files }})" - exit 1 - shell: - bash diff --git a/.github/workflows/manual-triggered-job-example.yml b/.github/workflows/manual-triggered-job-example.yml deleted file mode 100644 index a4bd8114be7..00000000000 --- a/.github/workflows/manual-triggered-job-example.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Manual Triggered Job Example - -permissions: - contents: read - -on: - workflow_dispatch: - -jobs: - test: - name: Test changed-files - runs-on: ${{ matrix.platform }} - strategy: - fail-fast: false - max-parallel: 7 - matrix: - platform: [ubuntu-latest, windows-latest, macos-latest] - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Run changed-files with defaults - id: changed-files - uses: ./ - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - - - name: Run changed-files with glob filtering - id: changed-files-glob - uses: ./ - with: - files: | - test/*.txt - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-glob.outputs) }}' - - - name: Run changed-files with glob filtering and all_old_new_renamed_files - id: changed-files-glob-all-old-new-renamed-files - uses: ./ - with: - include_all_old_new_renamed_files: true - files: | - test/*.txt - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-glob-all-old-new-renamed-files.outputs) }}' diff --git a/.github/workflows/matrix-example.yml b/.github/workflows/matrix-example.yml deleted file mode 100644 index 7d0e06e6a6a..00000000000 --- a/.github/workflows/matrix-example.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Matrix Example - -permissions: - contents: read - -on: - workflow_dispatch: - pull_request: - branches: - - main - -jobs: - changed-files: - name: Get changed files - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.changed-files.outputs.all_changed_files }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Get changed files - id: changed-files - uses: ./ - with: - matrix: true - - name: List all changed files - run: echo '${{ steps.changed-files.outputs.all_changed_files }}' - - matrix-job: - name: Run Matrix Job - runs-on: ubuntu-latest - needs: [changed-files] - strategy: - matrix: - files: ${{ fromJSON(needs.changed-files.outputs.matrix) }} - max-parallel: 4 - fail-fast: false - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Test - run: | - echo ${{ matrix.files }} diff --git a/.github/workflows/multi-job-example.yml b/.github/workflows/multi-job-example.yml deleted file mode 100644 index ad53c81b641..00000000000 --- a/.github/workflows/multi-job-example.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Multi Job Example - -permissions: - contents: read - -on: - push: - branches: - - "**" - pull_request: - branches: - - "**" - -jobs: - changed-files: - name: Get changed files - runs-on: ubuntu-latest - outputs: - all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Get changed files - id: changed-files - uses: ./ - - name: List all changed files - run: echo '${{ steps.changed-files.outputs.all_changed_files }}' - - view-changed-files: - name: View all changed files - runs-on: ubuntu-latest - needs: [changed-files] - steps: - - name: List all changed files - run: | - echo '${{ needs.changed-files.outputs.all_changed_files }}' - - - changed-files-rest-api: - name: Get changed files using REST API - runs-on: ubuntu-latest - outputs: - all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Get changed files - id: changed-files - continue-on-error: ${{ github.event_name == 'push' }} - uses: ./ - with: - use_rest_api: true - - name: List all changed files - run: echo '${{ steps.changed-files.outputs.all_changed_files }}' - - view-changed-files-rest-api: - name: View all changed files using REST API - runs-on: ubuntu-latest - needs: [changed-files-rest-api] - steps: - - name: List all changed files - run: | - echo '${{ needs.changed-files-rest-api.outputs.all_changed_files }}' diff --git a/.github/workflows/sync-release-version.yml b/.github/workflows/sync-release-version.yml deleted file mode 100644 index 5b3002eef3d..00000000000 --- a/.github/workflows/sync-release-version.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Update release version - -permissions: - contents: write - pull-requests: write - -on: - release: - types: [published] - - -jobs: - update-version: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Run release-tagger - uses: tj-actions/release-tagger@v4 - - name: Sync release version. - uses: tj-actions/sync-release-version@v13 - id: sync-release-version - with: - pattern: '${{ github.repository }}@' - only_major: true - paths: | - README.md - - name: Sync release package version. - uses: tj-actions/sync-release-version@v13 - id: sync-release-package-version - with: - pattern: '"version": "' - strip_prefix: "v" - paths: | - package.json - - name: Run git-cliff - uses: tj-actions/git-cliff@v1 - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7.0.5 - with: - base: "main" - labels: "merge when passing" - title: "Upgraded to ${{ steps.sync-release-version.outputs.new_version }}" - branch: "upgrade-to-${{ steps.sync-release-version.outputs.new_version }}" - commit-message: "Upgraded from ${{ steps.sync-release-version.outputs.old_version }} -> ${{ steps.sync-release-version.outputs.new_version }}" - body: "View [CHANGES](https://github.com/${{ github.repository }}/compare/${{ steps.sync-release-version.outputs.old_version }}...${{ steps.sync-release-version.outputs.new_version }})" - token: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 010788459b2..00000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,2237 +0,0 @@ -name: CI - -permissions: - contents: read - -on: - push: - branches: - - "**" - pull_request: - types: - - assigned - - unassigned - - labeled - - unlabeled - - opened - - edited - - closed - - reopened - - synchronize - - converted_to_draft - - ready_for_review - - locked - - unlocked - - review_requested - - review_request_removed - - auto_merge_enabled - - auto_merge_disabled - branches: - - "**" - -jobs: - build: - runs-on: ubuntu-latest - outputs: - files_changed: ${{ steps.changed_files.outputs.files_changed }} - permissions: - contents: read - pull-requests: write - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - fetch-depth: 0 - repository: ${{ github.event.pull_request.head.repo.full_name }} - - - name: Use Node.js 20.x - uses: actions/setup-node@v4.0.4 - with: - cache: 'yarn' - node-version: '20.x' - - - name: Create coverage directory and clover.xml - run: | - mkdir -p coverage - touch coverage/clover.xml - - - name: Install dependencies - run: | - yarn install - - - name: Run eslint on changed files - uses: tj-actions/eslint-changed-files@v25 - if: github.event_name == 'pull_request' - with: - token: ${{ secrets.PAT_TOKEN }} - config_path: ".eslintrc.json" - - - name: Run build and test - run: | - yarn all - env: - GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FORK: ${{ github.event.pull_request.head.repo.fork }} - - - name: Verify Changed files - uses: tj-actions/verify-changed-files@v20 - id: changed_files - with: - files: | - src - dist - - - name: Commit files - if: steps.changed_files.outputs.files_changed == 'true' && github.event_name == 'pull_request' - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add src dist - git commit -m "Added missing changes and modified dist assets." - - - name: Push changes - if: steps.changed_files.outputs.files_changed == 'true' && github.event_name == 'pull_request' - continue-on-error: true - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.PAT_TOKEN }} - branch: ${{ github.head_ref }} - - - name: Upload build assets - uses: actions/upload-artifact@v4 - with: - name: build-assets - path: dist - - - name: Run codacy-coverage-reporter - uses: codacy/codacy-coverage-reporter-action@v1 - continue-on-error: true - with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - coverage-reports: coverage/lcov.info - - test-multiple-repositories: - name: Test with multiple repositories - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: 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@v4 - with: - name: build-assets - path: dir1/dist - - - name: Run changed-files with defaults on the dir1 - id: changed-files-dir1 - uses: ./dir1 - with: - path: dir1 - - - name: Show output - run: | - 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 - echo "$file" - done - shell: - bash - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - path: dir2/dist - - - name: Checkout into dir2 - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - 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: | - 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 - echo "$file" - done - shell: - bash - - test-using-since-and-until: - name: Test changed-files using since and until - needs: build - runs-on: ubuntu-latest - if: github.event_name == 'push' && needs.build.outputs.files_changed != 'true' - permissions: - contents: read - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: 0 - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files since 2022-08-19 - id: changed-files-since - uses: ./ - with: - since: "2022-08-19" - - - name: Check output - if: "!contains(steps.changed-files-since.outputs.all_changed_files, '.github/workflows/sync-release-version.yml')" - run: | - echo "Invalid output: Expected to include (.github/workflows/sync-release-version.yml) got (${{ steps.changed-files-since.outputs.all_changed_files }})" - exit 1 - shell: - bash - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-since.outputs) }}' - shell: - bash - - - name: Run changed-files until 2022-08-20 - id: changed-files-until - uses: ./ - with: - until: "2022-08-20" - - - name: Check output - if: "!contains(steps.changed-files-until.outputs.all_changed_files, 'README.md')" - run: | - echo "Invalid output: Expected to include (README.md) got (${{ steps.changed-files-until.outputs.all_changed_files }})" - exit 1 - shell: - bash - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-until.outputs) }}' - shell: - bash - - test-similar-base-and-commit-sha: - name: Test changed-files similar base and commit sha - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: 0 - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files with similar base and commit sha - id: changed-files - continue-on-error: true - uses: ./ - with: - base_sha: d1c0ee4 - sha: d1c0ee4 - - - name: Exit with 1 if no error is raised - if: steps.changed-files.outcome != 'failure' - run: | - echo "Expected: (failure) got ${{ steps.changed-files.outcome }}" - exit 1 - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - shell: - bash - - test-using-branch-names-for-base-sha-and-sha-inputs: - name: Test using branch names for base_sha and sha inputs - runs-on: ubuntu-latest - needs: build - if: | - ( - github.event_name == 'push' || - github.event_name == 'pull_request' - ) && needs.build.outputs.files_changed != 'true' - permissions: - contents: read - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: 0 - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files with main as the base_sha - id: changed-files - uses: ./ - with: - base_sha: main - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - shell: - bash - - test-limited-commit-history: - name: Test changed-files with limited commit history - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - - strategy: - fail-fast: false - max-parallel: 4 - matrix: - fetch-depth: [1, 2, 50] - input-fetch_depth: [1, 2, 50] - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: ${{ matrix.fetch-depth }} - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files - id: changed-files - uses: ./ - continue-on-error: ${{ matrix.input-skip_initial_fetch == true && matrix.fetch-depth < 10 }} - with: - fetch_depth: ${{ matrix.input-fetch_depth }} - skip_initial_fetch: ${{ github.event_name == 'push' }} - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - shell: - bash - - test-pull-request-head-ref: - name: Test changed-files with pull request head ref - runs-on: ubuntu-latest - needs: build - if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true' - permissions: - contents: read - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files - id: changed-files - uses: ./ - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - shell: - bash - - test-pull-request-without-persist-credentials: - name: Test changed-files with pull request without persist credentials - runs-on: ubuntu-latest - needs: build - if: github.event_name != 'push' && needs.build.outputs.files_changed != 'true' - permissions: - contents: read - strategy: - fail-fast: false - max-parallel: 4 - matrix: - fetch-depth: [1, 2, 0] - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - fetch-depth: ${{ matrix.fetch-depth }} - persist-credentials: false - repository: ${{ github.event.pull_request.head.repo.full_name }} - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files - id: changed-files - uses: ./ - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - shell: - bash - - test-non-existent-base-sha: - name: Test changed-files non existent base sha - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - steps: - - name: Checkout branch - uses: actions/checkout@v4 - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files with non existent base sha - id: changed-files - uses: ./ - continue-on-error: true - with: - base_sha: "4554456" - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files.outputs) }}" - shell: - bash - - - name: Exit with 1 if no error is raised - if: steps.changed-files.outcome != 'failure' - run: | - echo "Expected: (failure) got ${{ steps.changed-files.outcome }}" - exit 1 - - - name: Run changed-files-specific with non existent base 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 - - - name: Exit with 1 if no error is raised - if: steps.changed-files-specific.outcome != 'failure' - run: | - echo "Expected: (failure) got ${{ steps.changed-files-specific.outcome }}" - exit 1 - - test-non-existent-sha: - name: Test changed-files non existent sha - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - steps: - - name: Checkout branch - uses: actions/checkout@v4 - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files with non existent sha - id: changed-files - uses: ./ - continue-on-error: true - with: - sha: "4774456" - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files.outputs) }}" - shell: - bash - - - name: Exit with 1 if no error is raised - if: steps.changed-files.outcome != 'failure' - run: | - echo "Expected: (failure) got ${{ steps.changed-files.outcome }}" - exit 1 - - - name: Run changed-files-specific with non existent sha - id: changed-files-specific - uses: ./ - continue-on-error: true - with: - files: action.yml - sha: "4774456" - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-specific.outputs) }}" - shell: - bash - - - name: Exit with 1 if no error is raised - if: steps.changed-files-specific.outcome != 'failure' - run: | - 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' && 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@v4 - 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-dir-names-nested-folder: - name: Test changed-files with dir-names in a nested folder - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - submodules: true - fetch-depth: 0 - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - path: dist - - - name: Get changed files in the .github folder - id: changed-files - uses: ./ - with: - path: .github - json: true - escape_json: false - dir_names: true - dir_names_exclude_current_dir: true - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files.outputs) }}" - 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: - contents: 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@v4 - 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 - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - strategy: - fail-fast: false - max-parallel: 4 - matrix: - fetch-depth: [0, 1, 2] - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - submodules: recursive - fetch-depth: ${{ matrix.fetch-depth }} - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files with submodule - id: changed-files - uses: ./ - with: - base_sha: "85bd869" - sha: "adde7bb" - fetch_depth: 60000 - - - name: Verify added files - if: steps.changed-files.outputs.added_files != 'test/demo/test/test.txt' - run: | - echo "Expected: (test/demo/test/test.txt) got ${{ steps.changed-files.outputs.added_files }}" - exit 1 - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files.outputs) }}" - shell: - bash - - - name: Run changed-files excluding submodule - id: changed-files-exclude-submodule - uses: ./ - with: - base_sha: "85bd869" - sha: "adde7bb" - fetch_depth: 60000 - exclude_submodules: true - - - name: Verify no added files - if: steps.changed-files-exclude-submodule.outputs.added_files != '' - run: | - echo "Expected: ('') got ${{ steps.changed-files-exclude-submodule.outputs.added_files }}" - exit 1 - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-exclude-submodule.outputs) }}" - shell: - bash - test-yaml: - name: Test changed-files with yaml - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - strategy: - fail-fast: false - max-parallel: 4 - matrix: - fetch-depth: [0, 1, 2] - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - submodules: recursive - fetch-depth: ${{ matrix.fetch-depth }} - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files with files_yaml - id: changed-files - uses: ./ - with: - files_yaml: | - test: - - test/**.txt - - test/**.md - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files.outputs) }}" - shell: - bash - - - name: Run changed-files with files_yaml_from_source_file - id: changed-files-from-source-file - uses: ./ - with: - files_yaml_from_source_file: | - test/changed-files.yml - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-from-source-file.outputs) }}" - shell: - bash - - - name: Run changed-files with files_yaml, files_ignore_yaml - id: changed-files-ignore - uses: ./ - with: - files_yaml: | - test: - - test/**.txt - - test/**.md - files_ignore_yaml: | - test: - - test/test.txt - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-ignore.outputs) }}" - shell: - bash - - - name: Run changed-files with files_yaml, json and write_output_files - id: changed-files-json-write-output-files - uses: ./ - with: - files_yaml: | - test: - - .github/workflows/test.yml - json: true - write_output_files: true - - - name: Show all outputs - run: | - echo "${{ toJSON(steps.changed-files-json-write-output-files.outputs) }}" - shell: - bash - - - name: Show all_changed_files output and list .github/outputs - run: | - echo '${{ toJSON(steps.changed-files-json-write-output-files.outputs.test_all_changed_files) }}' - cat .github/outputs/test_all_changed_files.json - shell: - bash - - test-recover-deleted-file: - name: Test changed-files recover deleted file - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - strategy: - fail-fast: false - max-parallel: 4 - matrix: - fetch-depth: [0, 1, 2] - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - submodules: recursive - fetch-depth: ${{ matrix.fetch-depth }} - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files with recover_deleted_files - id: changed-files-recover-deleted-files - uses: ./ - with: - base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338" - sha: "432e0c810c60ef1332850a971c5ec39022034b4c" - recover_deleted_files: true - fetch_depth: 60000 - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-recover-deleted-files.outputs) }}" - shell: - bash - - - name: Verify deleted files - if: steps.changed-files-recover-deleted-files.outputs.deleted_files != 'test/test deleted.txt' - run: | - echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files.outputs.deleted_files }}" - exit 1 - - - name: Verify that test/test deleted.txt is restored - run: | - if [ ! -f "test/test deleted.txt" ]; then - echo "Expected: (test/test deleted.txt) to exist" - exit 1 - else - cat "test/test deleted.txt" - rm "test/test deleted.txt" - fi - - - name: Run changed-files with recover_deleted_files and files input - id: changed-files-recover-deleted-files-with-files - uses: ./ - with: - base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338" - sha: "432e0c810c60ef1332850a971c5ec39022034b4c" - files: | - test/** - recover_deleted_files: true - fetch_depth: 60000 - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-recover-deleted-files-with-files.outputs) }}" - shell: - bash - - - name: Verify deleted files - if: steps.changed-files-recover-deleted-files-with-files.outputs.deleted_files != 'test/test deleted.txt' - run: | - echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-with-files.outputs.deleted_files }}" - exit 1 - - - name: Verify that test/test deleted.txt is restored - run: | - if [ ! -f "test/test deleted.txt" ]; then - echo "Expected: (test/test deleted.txt) to exist" - exit 1 - else - cat "test/test deleted.txt" - rm "test/test deleted.txt" - fi - - - name: Run changed-files with recover_deleted_files and files_yaml input - id: changed-files-recover-deleted-files-with-files-yaml - uses: ./ - with: - base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338" - sha: "432e0c810c60ef1332850a971c5ec39022034b4c" - files_yaml: | - test: - - test/**.txt - - test/**.md - recover_deleted_files: true - fetch_depth: 60000 - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-recover-deleted-files-with-files-yaml.outputs) }}" - shell: - bash - - - name: Verify deleted files - if: steps.changed-files-recover-deleted-files-with-files-yaml.outputs.test_deleted_files != 'test/test deleted.txt' - run: | - echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-with-files-yaml.outputs.test_deleted_files }}" - exit 1 - - - name: Verify that the modified_keys is correct - if: "!contains(steps.changed-files-recover-deleted-files-with-files-yaml.outputs.modified_keys, 'test')" - run: | - echo "Expected: (test) got ${{ steps.changed-files-recover-deleted-files-with-files-yaml.outputs.modified_keys }}" - exit 1 - - - name: Verify that test/test deleted.txt is restored - run: | - if [ ! -f "test/test deleted.txt" ]; then - echo "Expected: (test/test deleted.txt) to exist" - exit 1 - else - cat "test/test deleted.txt" - rm "test/test deleted.txt" - fi - - - name: Run changed-files with recover_deleted_files and recover_deleted_files_to_destination - id: changed-files-recover-deleted-files-to-destination - uses: ./ - with: - base_sha: "fcdeb5b3d797752d95f6dbe98552a95c29dad338" - sha: "432e0c810c60ef1332850a971c5ec39022034b4c" - recover_deleted_files: true - recover_deleted_files_to_destination: "deleted_files" - fetch_depth: 60000 - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-recover-deleted-files-to-destination.outputs) }}" - shell: - bash - - - name: Verify deleted files - if: steps.changed-files-recover-deleted-files-to-destination.outputs.deleted_files != 'test/test deleted.txt' - run: | - echo "Expected: (test/test deleted.txt) got ${{ steps.changed-files-recover-deleted-files-to-destination.outputs.deleted_files }}" - exit 1 - - - name: Verify that test/test deleted.txt is restored - run: | - if [ ! -f "deleted_files/test/test deleted.txt" ]; then - echo "Expected: (deleted_files/test/test deleted.txt) to exist" - exit 1 - else - cat "deleted_files/test/test deleted.txt" - fi - - - name: Run changed-files with recover_deleted_files for an expected git submodule file - id: changed-files-recover-deleted-files-within-submodule - uses: ./ - with: - base_sha: "3be651e99d3d4eae395694f6c6f3b9d18457f6c8" - sha: "d90c240f2ad4ec04d8f0f48e5ac290ad96ebe850" - recover_deleted_files: true - fetch_depth: 60000 - - - name: Show output - run: | - echo "${{ toJSON(steps.changed-files-recover-deleted-files-within-submodule.outputs) }}" - shell: - bash - - - name: Verify deleted files - if: steps.changed-files-recover-deleted-files-within-submodule.outputs.deleted_files != 'test/demo/.github/FUNDING.yml' - run: | - echo "Expected: (test/demo/.github/FUNDING.yml) got ${{ steps.changed-files-recover-deleted-files-within-submodule.outputs.deleted_files }}" - exit 1 - - name: Verify that test/demo/.github/FUNDING.yml is restored - run: | - if [ ! -f "test/demo/.github/FUNDING.yml" ]; then - echo "Expected: (test/demo/.github/FUNDING.yml) to exist" - exit 1 - else - cat "test/demo/.github/FUNDING.yml" - rm "test/demo/.github/FUNDING.yml" - fi - - test-dir-names-deleted-files-include-only-deleted-dirs-single-file: - name: Test dir names deleted files include only deleted dirs single file - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - ref: a52f8621d26d5d9f54b80f74bda2d9eedff94693 - repository: ${{ github.event.pull_request.head.repo.full_name }} - submodules: true - fetch-depth: 2 - - name: Run changed-files with dir_names and dir_names_deleted_files_include_only_deleted_dirs with a single file deleted withing the test directory - id: changed-files-dir-names-deleted-files-include-only-deleted-dirs-single-file - uses: ./ - with: - base_sha: 920856cfdd4b4be17810e34b197596397473adf6 - sha: a52f8621d26d5d9f54b80f74bda2d9eedff94693 - dir_names: true - dir_names_deleted_files_include_only_deleted_dirs: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-single-file.outputs) }}' - shell: - bash - - name: Check deleted_files output - if: steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-single-file.outputs.deleted_files != '' - run: | - echo "Invalid output: Expected '' got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-single-file.outputs.deleted_files }})" - exit 1 - shell: - bash - test-dir-names-deleted-files-include-only-deleted-dirs-directory: - name: Test dir names deleted files include only deleted dirs - runs-on: ${{ matrix.platform }} - needs: build - strategy: - matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - submodules: true - fetch-depth: 2 - - name: Run changed-files with dir_names and dir_names_deleted_files_include_only_deleted_dirs with the test directory deleted - id: changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory - uses: ./ - with: - base_sha: a52f8621d26d5d9f54b80f74bda2d9eedff94693 - sha: cd1e384723e4d1a184568182ac2b27c53ebf017f - dir_names: true - dir_names_deleted_files_include_only_deleted_dirs: true - fetch_depth: 60000 - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs) }}' - shell: - bash - - name: Check deleted_files output on non windows platform - if: steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs.deleted_files != 'test/test3' && runner.os != 'Windows' - run: | - echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs.deleted_files }})" - exit 1 - shell: - bash - - name: Check deleted_files output on windows platform - if: "!contains(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs.deleted_files, 'test\\test3') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected (test\\test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs.deleted_files }})" - exit 1 - shell: - bash - - name: Run changed-files with dir_names and dir_names_deleted_files_include_only_deleted_dirs with the test directory deleted returns posix path separator - id: changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator - uses: ./ - with: - base_sha: a52f8621d26d5d9f54b80f74bda2d9eedff94693 - sha: cd1e384723e4d1a184568182ac2b27c53ebf017f - dir_names: true - dir_names_deleted_files_include_only_deleted_dirs: true - use_posix_path_separator: true - fetch_depth: 60000 - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs) }}' - shell: - bash - - name: Check deleted_files output on non windows platform - if: steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files != 'test/test3' && runner.os != 'Windows' - run: | - echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files }})" - exit 1 - shell: - bash - - name: Check deleted_files output on windows platform - if: "!contains(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files, 'test/test3') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files }})" - exit 1 - shell: - bash - - test-since-last-remote-commit: - name: Test changed-files since last remote commit - runs-on: ubuntu-latest - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - strategy: - fail-fast: false - max-parallel: 4 - matrix: - fetch-depth: [0, 1, 2] - - steps: - - name: Checkout branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - submodules: true - fetch-depth: ${{ matrix.fetch-depth }} - - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - - name: Run changed-files with since_last_remote_commit - id: changed-files-since-last-remote-commit - continue-on-error: true - uses: ./ - with: - since_last_remote_commit: true - - - name: Verify succeeded pull_request(closed) - if: steps.changed-files-since-last-remote-commit.outcome != 'success' && matrix.fetch-depth == 1 && github.event.action == 'closed' && github.event_name == 'pull_request' - run: | - echo "Expected: (success) got ${{ steps.changed-files-since-last-remote-commit.outcome }}" - exit 1 - - - name: Verify succeeded - if: steps.changed-files-since-last-remote-commit.outcome != 'success' && matrix.fetch-depth != 1 - run: | - echo "Expected: (success) got ${{ steps.changed-files-since-last-remote-commit.outcome }}" - exit 1 - - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-since-last-remote-commit.outputs) }}' - shell: - bash - - test: - name: Test changed-files - runs-on: ${{ matrix.platform }} - needs: build - if: needs.build.outputs.files_changed != 'true' - permissions: - contents: read - strategy: - fail-fast: false - max-parallel: 4 - matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] - fetch-depth: [0, 1, 2] - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: ${{ matrix.fetch-depth }} - - name: Download build assets - uses: actions/download-artifact@v4 - with: - name: build-assets - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Run changed-files with defaults - id: changed-files - uses: ./ - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files.outputs) }}' - shell: - bash - - name: Run changed-files with dir name pattern - id: changed-files-dir-name - uses: ./ - with: - files: .github/workflows - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-name.outputs) }}' - shell: - bash - - name: Run changed-files with write_output_files - id: changed-files-write-output-files - uses: ./ - with: - json: true - write_output_files: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-write-output-files.outputs.all_changed_files) }}' - cat .github/outputs/all_changed_files.json - shell: - bash - - name: Run changed-files with include_all_old_new_renamed_files - id: changed-files-all-old-new-renamed-files - uses: ./ - with: - include_all_old_new_renamed_files: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files.outputs) }}' - shell: - bash - - name: List all modified files - run: | - for file in ${{ steps.changed-files.outputs.modified_files }}; do - echo $file - done - shell: - bash - - name: Run step when README.md changes - if: contains(steps.changed-files.outputs.modified_files, 'README.md') - run: | - echo "Your README.md has been modified ${{ steps.changed-files.outputs.modified_files }}." - shell: - bash - - name: Run changed-files with quotepath disabled for single path - id: changed-files-quotepath-specific - uses: ./ - with: - files: test/test-è.txt - quotepath: "false" - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-quotepath-specific.outputs) }}' - shell: - bash - - name: Run changed-files with quotepath disabled - id: changed-files-quotepath - uses: ./ - with: - quotepath: "false" - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-quotepath.outputs) }}' - shell: - bash - - name: Run changed-files with dir_names and dir_names_max_depth - id: changed-files-dir-names-max-depth - uses: ./ - with: - base_sha: ba788ed - sha: 0a5b7c6 - fetch_depth: 60000 - dir_names: "true" - dir_names_max_depth: 3 - dir_names_exclude_current_dir: "true" - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names-max-depth.outputs) }}' - shell: - bash - - name: Check dir_names output on non windows platform - if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test/test2/test3') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test2/test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})" - exit 1 - shell: - bash - - name: Check dir_names output on windows platform - if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test\\test2\\test3') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test2\\test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})" - exit 1 - shell: - bash - - name: Run changed-files with dir_names and dir_names_exclude_current_dir - id: changed-files-dir-names-exclude-root - uses: ./ - with: - base_sha: dddfbd69 - sha: ce8c1983 - fetch_depth: 60000 - dir_names: "true" - dir_names_exclude_current_dir: "true" - dir_names_max_depth: 1 - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names-exclude-root.outputs) }}' - shell: - bash - - name: Check dir_names output - if: steps.changed-files-dir-names-exclude-root.outputs.all_changed_files != '.github' - run: | - echo "Invalid output: Expected (.github) got (${{ steps.changed-files-dir-names-exclude-root.outputs.all_changed_files }})" - exit 1 - shell: - bash - - name: Run changed-files with dir_names - id: changed-files-dir-names - uses: ./ - with: - base_sha: d1c0ee4 - sha: 4d04215 - fetch_depth: 60000 - dir_names: "true" - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names.outputs) }}' - shell: - bash - - name: Check dir_names output - if: steps.changed-files-dir-names.outputs.all_changed_files != 'test' - run: | - echo "Invalid output: Expected (test) got (${{ steps.changed-files-dir-names.outputs.all_changed_files }})" - exit 1 - shell: - bash - - name: Run changed-files with dir_names specific - id: changed-files-dir-names-specific - uses: ./ - with: - base_sha: d1c0ee4 - sha: 4d04215 - fetch_depth: 60000 - dir_names: true - files: test/** - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names-specific.outputs) }}' - shell: - bash - - name: Check dir_names output - if: steps.changed-files-dir-names-specific.outputs.all_changed_files != 'test' - run: | - echo "Invalid output: Expected (test) got (${{ steps.changed-files-dir-names-specific.outputs.all_changed_files }})" - exit 1 - shell: - bash - - name: Run changed-files with dir_names and dir_names_include_files with specific files - id: changed-files-dir-names-specific-include-files - uses: ./ - with: - base_sha: d1c0ee4 - sha: 4d04215 - fetch_depth: 60000 - dir_names: true - dir_names_include_files: test/*.txt - files: test/** - json: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names-specific-include-files.outputs) }}' - shell: - bash - - name: Check dir_names output on non windows platform - if: | - ( - !contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test/test rename-1.txt') || - !contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test') || - steps.changed-files-dir-names-specific-include-files.outputs.any_changed == 'false' - ) && runner.os != 'Windows' - run: | - echo "Invalid output: Expected to include (test/test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})" - exit 1 - shell: - bash - - name: Check dir_names output on windows platform - if: | - ( - !contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test\\test rename-1.txt') || - !contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test') || - steps.changed-files-dir-names-specific-include-files.outputs.any_changed == 'false' - ) && runner.os == 'Windows' - run: | - echo "Invalid output: Expected to include (test\\test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})" - exit 1 - shell: - bash - - name: Run changed-files with dir_names for specific files and an unmatched path - id: changed-files-dir-names-specific-unmatched-path - uses: ./ - with: - base_sha: d1c0ee4 - sha: 4d04215 - fetch_depth: 60000 - dir_names: true - files: unknown/** - json: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-dir-names-specific-unmatched-path.outputs) }}' - shell: - bash - - name: Check dir_names output - if: | - ( - steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files != '[]' || - steps.changed-files-dir-names-specific-unmatched-path.outputs.any_changed == 'true' || - steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files_count != '0' - ) - run: | - echo "Invalid output: Expected empty array and any_changed to be false got (${{ steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files }}) and (${{ steps.changed-files-dir-names-specific-unmatched-path.outputs.any_changed }})" - exit 1 - shell: - bash - - 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 - - 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 - - name: Run changed-files with json output - id: changed-files-json - uses: ./ - with: - json: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-json.outputs) }}' - echo '${{ toJSON(steps.changed-files-json.outputs.all_changed_files) }}' - shell: - bash - - name: Run changed-files with json unescaped format - id: changed-files-json-unescaped - uses: ./ - with: - json: true - escape_json: false - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-json-unescaped.outputs) }}' - echo '${{ toJSON(steps.changed-files-json-unescaped.outputs.all_changed_files) }}' - shell: - bash - - name: Run changed-files with comma separator - id: changed-files-comma - uses: ./ - with: - separator: "," - - name: List all modified files - run: | - IFS=$',' read -a MODIFIED_FILES_ARRAY <<< "${{ steps.changed-files-comma.outputs.modified_files }}" - for file in "${MODIFIED_FILES_ARRAY[@]}"; do - echo $file - done - unset IFS - shell: - bash - - name: Show output - run: | - 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 - - name: Run changed-files for old new filenames test rename 1 - id: changed-files-all-old-new-renamed-files-1 - uses: ./ - with: - base_sha: d1c0ee4 - sha: 4d04215 - fetch_depth: 60000 - include_all_old_new_renamed_files: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}' - shell: - bash - - name: Check all_old_new_renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - name: Check all_old_new_renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test\\test rename 1.txt,test\\test rename-1.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename 1.txt,test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - name: Check the renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})" - exit 1 - shell: - bash - - name: Check the renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test\\test rename-1.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})" - exit 1 - shell: - bash - - name: Run changed-files for old new filenames test rename 2 - id: changed-files-all-old-new-renamed-files-2 - uses: ./ - with: - base_sha: 4d04215 - sha: fe238e6 - fetch_depth: 60000 - include_all_old_new_renamed_files: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}' - shell: - bash - - name: Check all_old_new_renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - name: Check all_old_new_renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test\\test rename 2.txt,test\\test rename-2.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - name: Check the renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})" - exit 1 - shell: - bash - - name: Check the renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test\\test rename-2.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})" - exit 1 - shell: - bash - - name: Run changed-files for old new filenames test rename 2 output as deleted and added - id: changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added - uses: ./ - with: - base_sha: 4d04215 - sha: fe238e6 - fetch_depth: 60000 - include_all_old_new_renamed_files: true - output_renamed_files_as_deleted_and_added: true - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs) }}' - shell: - bash - - name: Check all_old_new_renamed_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - name: Check all_old_new_renamed_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test\\test rename 2.txt,test\\test rename-2.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename 2.txt test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})" - exit 1 - shell: - bash - - name: Check deleted_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test/test rename 2.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})" - exit 1 - shell: - bash - - name: Check deleted_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test\\test rename 2.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})" - exit 1 - shell: - bash - - name: Check added_files output on non windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test/test rename-2.txt') && runner.os != 'Windows'" - run: | - echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})" - exit 1 - shell: - bash - - name: Check added_files output on windows platform - if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test\\test rename-2.txt') && runner.os == 'Windows'" - run: | - echo "Invalid output: Expected to not include (test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})" - exit 1 - shell: - bash - - name: Run changed-files with specific files - id: changed-files-specific - uses: ./ - with: - files: | - .github/workflows/test.yml - action.yml - **/test.txt - files_ignore: | - test/test/test.txt - - 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 on non windows platform - if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test/test.txt') && runner.os != 'Windows'" - 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: Check if a excluded file is not included in any_changed on windows platform - if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test\\test\\test.txt') && runner.os == 'Windows'" - 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 on non windows platform - 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') && runner.os != 'Windows'" - run: | - if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then - echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})" - exit 1 - fi - shell: - bash - - name: Verify any_changed for specific files on windows platform - 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') && runner.os == 'Windows'" - run: | - if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then - echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})" - exit 1 - fi - shell: - bash - - name: Check if a excluded file is not included in any_modified on non windows platform - if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test/test.txt') && runner.os != 'Windows'" - 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: Check if a excluded file is not included in any_modified on windows platform - if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test\\test\\test.txt') && runner.os == 'Windows'" - 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 on non windows platform - 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') && runner.os != 'Windows'" - 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: Verify any_modified for specific files on windows platform - 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') && runner.os == 'Windows'" - 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 an excluded file is included in deleted_files output on non windows platform - if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test/test/test.txt') && runner.os != 'Windows'" - 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: Check if an excluded file is included in deleted_files output on windows platform - if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test\\test\\test.txt') && runner.os == 'Windows'" - 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 on non windows platform - 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') && runner.os != 'Windows'" - 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 - - name: Verify any_deleted for specific files on windows platform - 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') && runner.os == 'Windows'" - 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 - - name: Run changed-files with specific files comma check duplicates - id: changed-files-specific-duplicate-output - uses: ./ - with: - files: | - get-changed-paths.sh - *.sh - - name: Verify all_changed_files files has no duplicates - if: contains(steps.changed-files-specific-duplicate-output.outputs.all_changed_files, 'get-changed-paths.sh') - 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, 'get-changed-paths.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) - - 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" - 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, 'get-changed-paths.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 - - name: Run changed-files with specific files comma separator - id: changed-files-specific-comma - uses: ./ - with: - files: | - .github/workflows/test.yml - action.yml - separator: "," - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-specific-comma.outputs) }}' - shell: - bash - - name: Verify any_changed files comma separator on non windows platform - 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') && runner.os != 'Windows'" - 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_changed files comma separator on windows platform - 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') && runner.os == 'Windows'" - 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 on non windows platform - 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') && runner.os != 'Windows'" - 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_modified files comma separator on windows platform - 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') && runner.os == 'Windows'" - 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 on non windows platform - 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') && runner.os != 'Windows'" - 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 - - name: Verify any_deleted files comma separator on windows platform - 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') && runner.os == 'Windows'" - 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 - - name: Run changed-files with specific files pipe separator - id: changed-files-specific-pipe - uses: ./ - with: - files: | - **/test.yml - action.yml - separator: "|" - - name: Show output - run: | - echo '${{ toJSON(steps.changed-files-specific-pipe.outputs) }}' - shell: - bash - - name: Verify any_changed files comma separator on non windows platform - 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') && runner.os != 'Windows'" - 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_changed files comma separator on windows platform - 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') && runner.os == 'Windows'" - 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 on non windows platform - 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') && runner.os != 'Windows'" - 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_modified files comma separator on windows platform - 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') && runner.os == 'Windows'" - 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 on non windows platform - 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') && runner.os != 'Windows'" - 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 - - name: Verify any_deleted files comma separator on windows platform - 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') && runner.os == 'Windows'" - 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 - - 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 on non windows platform - 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') && runner.os != 'Windows'" - run: | - 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_changed files forward slash separator on windows platform - 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') && runner.os == 'Windows'" - run: | - 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 forward slash separator on non windows platform - 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') && runner.os != 'Windows'" - 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_modified files forward slash separator on windows platform - 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') && runner.os == 'Windows'" - 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 on non windows platform - 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') && runner.os != 'Windows'" - 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: Verify any_deleted files forward slash separator on windows platform - 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') && runner.os == 'Windows'" - 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: Show output - run: | - echo '${{ toJSON(steps.changed-files-specific-source-file.outputs) }}' - shell: - bash - - name: Check if a excluded file is not included in any_changed on non windows platform - if: "contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test/test.txt') && runner.os != 'Windows'" - 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: Check if a excluded file is not included in any_changed on windows platform - if: "contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test\\test\\test.txt') && runner.os == 'Windows'" - 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 on non windows platform - 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, 'test/test.txt') && - !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test.txt') && - !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') && - !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '[test new].txt') && - !contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml') && - runner.os != 'Windows' - ) - run: | - 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 on non windows platform - if: "contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test/test.txt') && runner.os != 'Windows'" - 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: Check if a excluded file is not included in any_modified on windows platform - if: "contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test\\test\\test.txt') && runner.os == 'Windows'" - 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 on non windows platform - 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, 'test/test.txt') && - !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test.txt') && - !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') && - !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '[test new].txt') && - !contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml') && - runner.os != 'Windows' - ) - 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 on non windows platform - if: "contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test/test.txt') && runner.os != 'Windows'" - 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: Check if a excluded file is not included in any_deleted on windows platform - 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 on non windows platform - 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') && - !contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test.txt') && - !contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') && - !contains(steps.changed-files-specific-source-file.outputs.deleted_files, '[test new].txt') && - !contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/greetings.yml') && - runner.os != 'Windows' - ) - 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: | - 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 from source files on non windows platform - 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-source-file.outputs.all_changed_files, 'test/test.txt') && - !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test.txt') && - !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') && - !contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '[test new].txt') && - runner.os != 'Windows' - ) - run: | - 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 from source files on non windows platform - 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-source-file.outputs.all_modified_files, 'test/test.txt') && - !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test.txt') && - !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') && - !contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '[test new].txt') && - runner.os != 'Windows' - ) - 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: Get branch name - id: branch-name - uses: tj-actions/branch-names@v8 - if: github.event_name == 'pull_request' && matrix.fetch-depth == 0 - - uses: nrwl/nx-set-shas@v4 - id: last_successful_commit - if: github.event_name == 'pull_request' && github.event.action != 'closed' && matrix.fetch-depth == 0 - with: - main-branch-name: ${{ steps.branch-name.outputs.base_ref_branch }} - workflow-id: 'test.yml' - - name: Run changed-files with a custom base sha - if: github.event_name != 'push' && github.event.action != 'closed' && matrix.fetch-depth == 0 && steps.last_successful_commit.outputs.base != steps.last_successful_commit.outputs.head - id: changed-files-custom-base-sha - uses: ./ - with: - base_sha: ${{ steps.last_successful_commit.outputs.base }} - - name: Show output - if: github.event_name == 'pull_request' && github.event.action != 'closed' && matrix.fetch-depth == 0 - run: | - echo '${{ toJSON(steps.changed-files-custom-base-sha.outputs) }}' - shell: - bash - - name: Run changed-files with custom sha - id: changed-files-custom-sha - if: github.event_name == 'pull_request' && github.event.action != 'closed' - uses: ./ - with: - sha: ${{ github.event.pull_request.head.sha }} - - name: Show output - if: github.event.action != 'closed' - run: | - echo '${{ toJSON(steps.changed-files-custom-sha.outputs) }}' - shell: - bash - - name: Run changed-files with the pull request base sha and head sha - id: changed-files-pull-request-base-sha-head-sha - if: github.event_name == 'pull_request' && github.event.action != 'closed' - uses: ./ - with: - base_sha: ${{ github.event.pull_request.base.sha }} - sha: ${{ github.event.pull_request.head.sha }} - - name: Show output - if: github.event.action != 'closed' - run: | - echo '${{ toJSON(steps.changed-files-pull-request-base-sha-head-sha.outputs) }}' - shell: - bash - - name: Run changed-files with specific files (only-changed) - id: changed-files-specific-only-changed - uses: ./ - with: - files: | - .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: | - echo '${{ toJSON(steps.changed-files-specific-only-changed.outputs) }}' - shell: - bash diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml deleted file mode 100644 index 84974d41f87..00000000000 --- a/.github/workflows/update-readme.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Format README.md - -permissions: - contents: read - pull-requests: write - -on: - push: - branches: - - main - -jobs: - sync-assets: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Run auto-doc - uses: tj-actions/auto-doc@v3 - with: - use_code_blocks: true - use_major_version: true - - - name: Run remark - uses: tj-actions/remark@v3 - - - name: Verify Changed files - uses: tj-actions/verify-changed-files@v20 - id: verify_changed_files - with: - files: | - README.md - - - name: README.md changed - if: steps.verify_changed_files.outputs.files_changed == 'true' - run: | - echo "README.md has uncommitted changes" - exit 1 - - - name: Create Pull Request - if: failure() - uses: peter-evans/create-pull-request@v7 - with: - base: "main" - labels: "merge when passing" - title: "Updated README.md" - branch: "chore/update-readme" - commit-message: "Updated README.md" - body: "Updated README.md" - token: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/workflow-run-example.yml b/.github/workflows/workflow-run-example.yml deleted file mode 100644 index 40e00cfb55e..00000000000 --- a/.github/workflows/workflow-run-example.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Workflow Run Example -on: - workflow_run: - workflows: [Matrix Example] - types: [completed] - -permissions: - contents: read - -jobs: - on-success: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Get changed files - id: changed-files - uses: ./ - - - name: Echo list of changed files on success - run: | - echo "Changed files on success:" - echo "${{ steps.changed-files.outputs.all_changed_files }}" - - on-failure: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'failure' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Get changed files - id: changed-files - uses: ./ - - - name: Echo list of changed files on failure - run: | - echo "Changed files on failure:" - echo "${{ steps.changed-files.outputs.all_changed_files }}"