Skip to content

[Coffee Maker Example App] Simulate polling for fetching coffee orders #12

[Coffee Maker Example App] Simulate polling for fetching coffee orders

[Coffee Maker Example App] Simulate polling for fetching coffee orders #12

Workflow file for this run

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/[email protected]
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.'
})