Skip to content

cssnr/validate-outputs-action

Repository files navigation

GitHub Tag Major GitHub Tag Minor GitHub Release Version GitHub Dist Size Workflow Release Workflow Test Workflow Lint Quality Gate Status GitHub Last Commit Codeberg Last Commit GitHub Contributors GitHub Repo Size GitHub Top Language GitHub Discussions GitHub Forks GitHub Repo Stars GitHub Org Stars Discord Ko-fi

Validate Outputs Action

Easily Validate Outputs from a GitHub Action or Workflow.

- name: 'Validate Outputs'
  uses: cssnr/validate-outputs-action@master
  with:
    outputs: ${{ toJSON(steps.test.outputs) }}
    data: |
      output1: must equal this
      output2: # must exist
      output3: ${{ steps.validate.outputs.output3 }}

Inputs

Input Required Value for the Input Input Description
outputs ${{ toJSON(steps.test.outputs) }} Outputs JSON Data
data Data to Verify in YAML format Validation YAML Data

outputs

This should be your outputs JSON. If your step is named test set:

outputs: ${{ toJSON(steps.test.outputs) }}

data

This is the data to validate the outputs.

Keys are Output Keys. If you set a value it will be checked for equality, otherwise only for existence.

data: |
  output1: must equal this
  output2: # must exist
  output3: ${{ steps.validate.outputs.output3 }}

Outputs

Output Description
errors Errors JSON Object
keys Checked JSON Keys
failed Failed JSON Keys
- name: 'Validate Outputs'
  id: test
  uses: cssnr/validate-outputs-action@master
  with:
    outputs: ${{ toJSON(steps.test.outputs) }}
    data: |
      output1: must equal this

- name: 'Echo Outputs'
  run: |
    echo "errors: ${{ steps.test.outputs.errors }}"
    echo "keys: ${{ steps.test.outputs.keys }}"
    echo "failed: ${{ steps.test.outputs.failed }}"

Examples

💡 Click on an example heading to expand or collapse the example.

Examples Coming Soon...

For more examples, you can check out other projects using this action:
https://github.com/cssnr/validate-outputs-action/network/dependents

Tags

The following rolling tags are maintained.

Version Tag Rolling Bugs Feat. Name Target Example
GitHub Tag Major Major vN.x.x vN
GitHub Tag Minor Minor vN.N.x vN.N
GitHub Release Micro vN.N.N vN.N.N

You can view the release notes for each version on the releases page.

The Major tag is recommended. It is the most up-to-date and always backwards compatible. Breaking changes would result in a Major version bump. At a minimum you should use a Minor tag.

Support

For general help or to request a feature, see:

If you are experiencing an issue/bug or getting unexpected results, you can:

For more information, see the CSSNR SUPPORT.md.

Contributing

If you would like to submit a PR, please review the CONTRIBUTING.md.

Please consider making a donation to support the development of this project and additional open source projects.

Ko-fi

Actions Tools

Additionally, you can support other GitHub Actions I have published:

❔ Unpublished Actions

These actions are not published on the Marketplace, but may be useful.


📝 Template Actions

These are basic action templates that I use for creating new actions.

Note: The docker-test-action builds, runs and pushes images to GitHub Container Registry.


For a full list of current projects visit: https://cssnr.github.io/

About

Easily Validate Outputs from a GitHub Action or Workflow.

Topics

Resources

Contributing

Stars

Watchers

Forks

Sponsor this project