-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from jerensl/fix/single-file-with-no-newline
fix: fix single file with no newline will fail the action
- Loading branch information
Showing
3 changed files
with
22 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected].15 | ||
uses: layer5labs/[email protected].16 | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
mesheryToken: ${{ secrets.MESHERY_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected].15 | ||
uses: layer5labs/[email protected].16 | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
mesheryToken: ${{ secrets.MESHERY_TOKEN }} | ||
|