Filter a json file produced by viash ns list on whether the component has been changed with respect to the default branch.
The action will simply return the contents of the input file if:
- The current branch is the default branch
- The event is a pull request and the commit message contains ‘ci force’
project_directory
: - optional. Path to the project directory. This is the directory where the project config_viash.yaml
is located.input_file
: - required. Path to a viash ns list json file
-
output_file
: Path to the filtered viash ns list json file, filtered on whether one of the resources of the component has been changed or not. -
output_matrix
: Matrix of components that have changed resources. The matrix is a json array with the following fields: -
name: The name of the component
-
namespace: The namespace of the component
-
full_name: The full name of the component
-
config: The path to the config file of the component
-
dir: The directory of the config file of the component
-
main_script_type: The type of the main script of the component
name: Demo of detect-changed-components
on:
push:
jobs:
demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: ns_list
uses: viash-io/viash-actions/ns-list@v6
with:
format: json
- name: Detect components with changed files
id: ns_list_changed
uses: viash-io/viash-actions/detect-changed-components@v6
with:
input_file: ${{ steps.ns_list.outputs.output_file }}