Skip to content

Commit

Permalink
Tweak the code to satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mikogs committed Oct 24, 2023
1 parent 39e7c97 commit 31400b3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/test-replace-string.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v4

- name: Replace string
id: replace-string
id: str
uses: ./replace-string
with:
string: 'Apple Redberry'
Expand All @@ -30,8 +30,8 @@ jobs:
- name: Check replaced string
shell: bash
run: |
if [[ '${{ steps.replace-string.outputs.replaced-string }}' != 'Apple Apricot' ]]; then
echo '!!! Action replace-string failed to make simple string replacement'
if [[ '${{ steps.str.outputs.replaced-string }}' != 'Apple Apricot' ]]; then
echo '!!! Action failed to make simple string replacement'
exit 1
fi
Expand All @@ -41,7 +41,7 @@ jobs:
echo -n 'Apricot Blueberry' > tmp-read-from-file.txt
- name: Replace string from file
id: replace-from-file
id: from-file
uses: ./replace-string
with:
read-from-file: 'tmp-read-from-file.txt'
Expand All @@ -52,8 +52,8 @@ jobs:
- name: Check replaced string
shell: bash
run: |
if [[ '${{ steps.replace-from-file.outputs.replaced-string }}' != 'Apricot Redberry' ]]; then
echo '!!! Action replace-string failed to replace string from a file'
if [[ '${{ steps.from-file.outputs.replaced-string }}' != 'Apricot Redberry' ]]; then
echo '!!! Action failed to replace string from a file'
exit 1
fi
Expand All @@ -64,7 +64,6 @@ jobs:
echo "read-me=Cranberry and green apple" >> $GITHUB_OUTPUT
- name: Replace string from output and write to file
id: replace-to-file
uses: ./replace-string
with:
string: ${{ steps.output.outputs.read-me }}
Expand All @@ -77,9 +76,9 @@ jobs:
shell: bash
run: |
if [[ ! -f tmp-write-to-file.txt ]]; then
echo "!!! Action replace-string failed to create an output file"
echo "!!! Action failed to create an output file"
fi
output_from_file=$(cat tmp-write-to-file.txt);
if [[ "${output_from_file}" != 'Cranberry and red apple' ]]; then
echo "!!! Action replace-string failed to create an output file with properly replaced string"
echo "!!! Action failed to create an output file with replaced string"
fi

0 comments on commit 31400b3

Please sign in to comment.