Skip to content

[Feature] Add possibility to not raise if base and head sha are the same #2708

@ovsds

Description

@ovsds

Is this feature missing in the latest version?

  • I'm using the latest release

Is your feature request related to a problem? Please describe.

We are using in pipeline when sometimes it's expected that inputs.base_sha==inputs.sha, and we expect the result to be emptry on the next step.

Describe the solution you'd like?

Would be nice to have opportynity to overload result, or just pass the flag that allows not to raise error in that case.

Describe alternatives you've considered?

Now we use this workaround:

    - uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62
      id: changed-files-base
      if: ${{ steps.extract_base_commit.outputs.result != steps.extract_head_commit.outputs.result }}
      with:
        base_sha: ${{ steps.extract_base_commit.outputs.result }}
        sha: ${{ steps.extract_head_commit.outputs.result }}
        write_output_files: true
        separator: "\n"

    - name: Get changed files
      id: changed-files
      run: |
        if [ "$base_sha" != "$sha" ]; then
          {
            echo "all_changed_files<<EOF"
            echo "${changed_files_base}"
            echo "EOF"
          } >> "$GITHUB_OUTPUT"
        fi
      env:
        sha: ${{ steps.extract_head_commit.outputs.result }}
        base_sha: ${{ steps.extract_base_commit.outputs.result }}
        changed_files_base: ${{ steps.changed-files-base.outputs.all_changed_files }}

Anything else?

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions