Improve cowsay comments #3046
Workflow file for this run
This file contains hidden or 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
| name: Validate PR Metadata and Check SDC-Tools Tasks | |
| on: | |
| pull_request: | |
| types: | |
| - labeled | |
| - opened | |
| - edited | |
| - reopened | |
| jobs: | |
| validate_pr_metadata: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: CodeYourFuture/actions/validate-pr-metadata@main | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| test_sdc_tasks: | |
| name: Test SDC Tasks | |
| runs-on: ubuntu-slim | |
| permissions: | |
| pull-requests: write | |
| if: ${{ github.event.label.name == 'Needs Review' }} | |
| steps: | |
| - name: checkout base branch | |
| uses: actions/checkout@v5 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v47.0.5 | |
| - name: test individual shell tools | |
| id: test-individual-shell-tools | |
| if: contains(steps.changed-files.outputs.modified_files, 'individual-shell-tools/') | |
| run: ./test-sdc.sh individual-shell-tools | |
| shell: bash | |
| - name: test jq | |
| id: test-jq | |
| if: contains(steps.changed-files.outputs.modified_files, 'jq/') | |
| run: ./test-sdc.sh jq | |
| shell: bash | |
| - name: test shell-pipelines | |
| id: test-shell-pipelines | |
| if: contains(steps.changed-files.outputs.modified_files, 'shell-pipelines/') | |
| run: ./test-sdc.sh shell-pipelines | |
| shell: bash | |
| - name: test number-systems | |
| id: test-number-systems | |
| if: contains(steps.changed-files.outputs.modified_files, 'number-systems/') | |
| run: ./test-sdc.sh number-systems | |
| shell: bash | |
| - name: test implement-cowsay | |
| id: test-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 | |
| if: steps.test-individual-shell-tools.outputs.attempted == 'y' || steps.test-jq.outputs.attempted == 'y' || steps.test-shell-pipelines.outputs.attempted == 'y' || steps.test-number-systems.outputs.attempted == 'y' || steps.test-implement-cowsay.outputs.attempted == 'y' | |
| env: | |
| 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' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ISSUE_URL: ${{ github.event.pull_request.html_url }} | |
| run: | | |
| gh pr edit $ISSUE_URL --add-label "Complete" | |
| gh pr edit $ISSUE_URL --remove-label "Needs Review" | |
| - name: fail if not complete | |
| if: (steps.test-individual-shell-tools.outputs.attempted == 'y' || steps.test-jq.outputs.attempted == 'y' || steps.test-shell-pipelines.outputs.attempted == 'y' || steps.test-implement-cowsay.outputs.attempted == 'y') && !(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') | |
| run: | | |
| exit -1 |