Skip to content

Output not provided when no matching commit is found #30

@adamkudrna

Description

@adamkudrna

Describe the bug

I think an output should be always provided, not only when there is a commit with matching version number in the commit message and in the diff.

The README says:

changed: either "true" or "false"

The example with steps.check.outputs.changed != 'true' could become steps.check.outputs.changed == 'false'. The != 'true' comparison is currently triggered because there is another, non-boolean output which is logged as an empty string '' and also complies with != 'true'.

To Reproduce

  1. Push a commit without changes in package.json.
  2. Get this workflow triggered:
      - name: Check package.json for version change
        id: check_package_version
        uses: EndBug/version-check@v1.6.0

      - name: Log when version changed
        if: steps.check_package_version.outputs.changed == 'true'
        run: 'echo "Version change found in commit ${{ steps.check_package_version.outputs.commit }}! New version: ${{ steps.check_package_version.outputs.version }} (${{ steps.check_package_version.outputs.type }})"'

      - name: Log when version unchanged
        if: steps.check_package_version.outputs.changed != 'true'
        run: 'echo "No version change (${{ steps.check_package_version.outputs.changed }})"'

(Source: react-ui-org/react-ui@14bd0bc#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88R60)

Expected behavior

steps.check_package_version.outputs.changed outputs 'false'.

Actual behavior

steps.check_package_version.outputs.changed outputs ''.

Screenshots

Snímek obrazovky 2020-11-11 v 13 15 03

Metadata

Metadata

Assignees

Labels

type: featureNew feature or feature request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions