diff --git a/.github/workflows/validate-pr-metadata.yml b/.github/workflows/validate-pr-metadata.yml index b4ff6020..6fa2e1db 100644 --- a/.github/workflows/validate-pr-metadata.yml +++ b/.github/workflows/validate-pr-metadata.yml @@ -50,7 +50,7 @@ jobs: shell: bash - name: test implement-cowsay id: test-implement-cowsay - if: contains(steps.changed-files.outputs.modified_files, 'implement-cowsay/') + if: contains(steps.changed-files.outputs.all_modified_files, 'implement-cowsay/') run: ./test-sdc.sh implement-cowsay shell: bash - name: make output comment @@ -59,6 +59,8 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ISSUE_URL: ${{ github.event.pull_request.html_url }} run: | + gh release -R CodeYourFuture/trainee-tracker view --json assets -q ".assets[] | select(.name | startswith(\"pr-metadata-validator-musl-\")).url" | xargs curl --fail -L -o /tmp/pr-metadata-validator && chmod 0755 /tmp/pr-metadata-validator + /tmp/pr-metadata-validator --only-close-existing-comments-with-tag="sdc-test-results" "${ISSUE_URL}" gh pr comment $ISSUE_URL --body-file testoutput.txt - name: add appropriate labels if: steps.test-individual-shell-tools.outputs.complete == 'y' || steps.test-jq.outputs.complete == 'y' || steps.test-shell-pipelines.outputs.complete == 'y' || steps.test-implement-cowsay.outputs.complete == 'y' diff --git a/test-sdc.sh b/test-sdc.sh index adc8dc43..62d1c7e1 100755 --- a/test-sdc.sh +++ b/test-sdc.sh @@ -5,7 +5,7 @@ # You can run this file using ./test-sdc.sh task-directory-name to check your output echo "" > testoutput.txt -echo "Results of test" >> testoutput.txt +echo "Results of test:" >> testoutput.txt if [[ "$1" == "individual-shell-tools" ]]; then cd individual-shell-tools @@ -148,14 +148,14 @@ elif [[ "$1" == "implement-cowsay" ]]; then python3 implement-cowsay/cow.py Grass, delicious > test.tmp cmp test.tmp expect/implement-cowsay/cow-grass.txt if [ $? -ne 0 ]; then - echo "Unexpected cowsay output for Grass, delicious" >> testoutput.txt + echo "Unexpected cowsay output for 'Grass, delicious'." >> testoutput.txt all_ok=false fi python3 implement-cowsay/cow.py --animal turtle "Fish are cool!" > test.tmp cmp test.tmp expect/implement-cowsay/turtle-fish.txt if [ $? -ne 0 ]; then - echo "Unexpected cowsay output for Fish are cool!" >> testoutput.txt + echo "Unexpected cowsay output for --animal turtle Fish are cool!" >> testoutput.txt all_ok=false fi @@ -172,7 +172,8 @@ elif [[ "$1" == "implement-cowsay" ]]; then fi if [[ "${all_ok}" == "true" && -v GITHUB_OUTPUT ]]; then - echo "completed=y" >> "$GITHUB_OUTPUT" + echo "complete=y" >> "$GITHUB_OUTPUT" + echo "Your implementation passed all checks." >> testoutput.txt fi fi fi