Workflow file for this run
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 PR for changes in autopts/wid/ | ||
on: | ||
pull_request_target: | ||
types: [ready_for_review, opened] | ||
branches: | ||
- master | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
CHANGES_DETECTED: 0 | ||
jobs: | ||
check_changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Print initial CHANGES_DETECTED value | ||
run: | ||
echo "$CHANGES_DETECTED" | ||
echo ${{ env.CHANGES_DETECTED }} | ||
- name: Check for changes in autopts/wid directory | ||
id: check_changes | ||
run: | | ||
python .github/check_for_changes.py | ||
echo ${{ env.CHANGES_DETECTED }} | ||
echo "$CHANGES_DETECTED" | ||
- name: Set output | ||
id: set_output | ||
if: [ "$CHANGES_DETECTED" -eq 1 ]; then | ||
run: | | ||
echo "$CHANGES_DETECTED" | ||
echo "changed_files=$(cat changed_files_formatted.txt)" >> $GITHUB_OUTPUT | ||
- name: Print changed | ||
if: [ "$CHANGES_DETECTED" -eq 1 ]; then | ||
run: | | ||
echo "Changed files: ${{ steps.set_output.outputs.changed_files }}" | ||
- name: Post comment on PR | ||
if: [ "$CHANGES_DETECTED" -eq 1 ]; then | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
\#AutoPTS run mynewt ${{ steps.set_output.outputs.changed_files }} --test-case-limit 10 | ||
- name: Post comment on PR | ||
if: [ "$CHANGES_DETECTED" -eq 1 ]; then | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
\#AutoPTS run zephyr ${{ steps.set_output.outputs.changed_files }} --test-case-limit 10 |