From b14f7149db7b541e4189a31a2166197d14e1666f Mon Sep 17 00:00:00 2001 From: Rudra-IITM Date: Mon, 2 Dec 2024 15:55:45 +0530 Subject: [PATCH] Update `action.yml` to handle undefined `yaml-path` arg --- action.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 101c933..7a926a7 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,6 @@ inputs: yaml-path: description: 'Path to the YAML file' required: false - default: 'None' # Outputs generated by running this action. outputs: @@ -53,7 +52,7 @@ runs: - name: run updatesnapyaml id: updatesnapyaml run: | - ./desktop-snaps/updatesnap/updatesnapyaml.py --github-user $GITHUB_USER --github-token $GITHUB_TOKEN --version-schema $VERSION_SCHEMA --rock-version-schema $ROCK_VERSION_SCHEMA --yaml-path $YAML_PATH https://github.com/${{ github.repository }} + ./desktop-snaps/updatesnap/updatesnapyaml.py --github-user $GITHUB_USER --github-token $GITHUB_TOKEN --version-schema $VERSION_SCHEMA --rock-version-schema $ROCK_VERSION_SCHEMA ${YAML_PATH:+--yaml-path $YAML_PATH} https://github.com/${{ github.repository }} # Make sure to put the updated snapcraft.yaml file in the right location if it lives in a snap directory if [ -f version_file ]; then echo "IS_VERSION_CHANGE=true" >> $GITHUB_ENV @@ -61,7 +60,7 @@ runs: fi if [ -f output_file ]; then echo "IS_CHANGE=true" >> $GITHUB_ENV - if [ "$YAML_PATH" != 'None' ]; then + if [ -n "$YAML_PATH" ]; then mv output_file $YAML_PATH elif [ -f rockcraft.yaml ]; then mv output_file rockcraft.yaml