[Demo App] Add widgetbook to coffee maker demo app #54
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
name: Check for Tests in PR | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
check-for-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Check for changes in test directory | |
id: check-tests | |
run: | | |
git status --porcelain > changed_files.txt | |
if grep -qE "^[AM]\s+test/" changed_files.txt; then | |
echo "Tests found in the PR" | |
echo "tests_present=true" >> $GITHUB_OUTPUT | |
else | |
echo "No tests found in the PR" | |
echo "tests_present=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Comment on PR if tests are missing | |
if: steps.check-tests.outputs.tests_present == 'false' | |
uses: actions/github-script@v7.0.1 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'It appears that this PR does not include any tests. It is recommended to add tests, especially for critical changes, to ensure code quality and prevent regressions. However, if this PR is only updating samples or documentation, feel free to skip adding tests and disregard this comment.' | |
}) |