diff --git a/manifest-merger.sh b/manifest-merger.sh index 21a9fa1..eb17416 100755 --- a/manifest-merger.sh +++ b/manifest-merger.sh @@ -1,14 +1,21 @@ touch __intermediate_file.yml echo $FILE_PATH + +append_with_newline() { + file=$1 + cat "$file" >> __intermediate_file.yml + if [ -n "$(tail -c 1 "$file")" ]; then + echo "" >> __intermediate_file.yml + fi + echo "---" >> __intermediate_file.yml +} + if [[ -d $FILE_PATH ]]; then - for file in $FILE_PATH/*; do # FILE_PATH is the environment variable - echo $file - if [[ $file == *yaml ]] || [[ $file == *yml ]] - then - cat $file >> __intermediate_file.yml - echo "---" >> __intermediate_file.yml + for file in "$FILE_PATH"/*; do + if [[ $file == *.yaml || $file == *.yml ]]; then + append_with_newline "$file" fi - done; + done else - cat $FILE_PATH >> __intermediate_file.yml -fi + append_with_newline "$FILE_PATH" +fi \ No newline at end of file diff --git a/workflow-templates/file-uploadTemplate.yaml b/workflow-templates/file-uploadTemplate.yaml index 99834a4..1f8729a 100644 --- a/workflow-templates/file-uploadTemplate.yaml +++ b/workflow-templates/file-uploadTemplate.yaml @@ -1,6 +1,6 @@ name: Kanvas Screenshot Service -'on': - pull_request_target: +on: + pull_request: types: - opened - synchronize @@ -38,7 +38,7 @@ jobs: path: action repository: layer5labs/kanvas-snapshot - id: test_result - uses: layer5labs/kanvas-snapshot@v0.2.15 + uses: layer5labs/kanvas-snapshot@v0.2.16 with: githubToken: ${{ secrets.GITHUB_TOKEN }} mesheryToken: ${{ secrets.MESHERY_TOKEN }} diff --git a/workflow-templates/url-uploadTemplate.yaml b/workflow-templates/url-uploadTemplate.yaml index 25420ea..1ce20ba 100644 --- a/workflow-templates/url-uploadTemplate.yaml +++ b/workflow-templates/url-uploadTemplate.yaml @@ -1,6 +1,6 @@ name: Kanvas Snapshot With URL-Upload -'on': - pull_request_target: +on: + pull_request: types: - opened - synchronize @@ -30,7 +30,7 @@ jobs: path: action repository: layer5labs/kanvas-snapshot - id: test_result - uses: layer5labs/kanvas-snapshot@v0.2.15 + uses: layer5labs/kanvas-snapshot@v0.2.16 with: githubToken: ${{ secrets.GITHUB_TOKEN }} mesheryToken: ${{ secrets.MESHERY_TOKEN }}