Skip to content

Commit a62b94a

Browse files
committed
fix: Add debug output to module monitor workflow for troubleshooting
1 parent 3336395 commit a62b94a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/module-monitor.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
paths:
55
- 'zephyr/module.yml'
6-
pull_request_target:
6+
pull_request:
77
paths:
88
- 'zephyr/module.yml'
99

@@ -20,6 +20,7 @@ jobs:
2020
- name: Checkout the code
2121
uses: actions/checkout@v4
2222
with:
23+
ref: ${{ github.event.pull_request.head.sha }}
2324
fetch-depth: 0
2425
persist-credentials: false
2526

@@ -40,10 +41,15 @@ jobs:
4041
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha || '' }}
4142
run: |
4243
# For pull requests, compare with base branch
43-
if [ "$GITHUB_EVENT_NAME" = "pull_request_target" ]; then
44+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
4445
BASE_REF="$GITHUB_BASE_SHA"
4546
HEAD_REF="$GITHUB_HEAD_SHA"
47+
echo "DEBUG: Comparing $BASE_REF to $HEAD_REF" >&2
48+
echo "DEBUG: Current HEAD is $(git rev-parse HEAD)" >&2
49+
echo "DEBUG: Available commits:" >&2
50+
git log --oneline -5 >&2
4651
DIFF_OUTPUT=$(git diff $BASE_REF $HEAD_REF -- zephyr/module.yml || echo "No changes found")
52+
echo "DEBUG: Diff result: $DIFF_OUTPUT" >&2
4753
else
4854
# For push events, get the previous commit that modified module.yml
4955
PREV_COMMIT=$(git log --oneline --follow -- zephyr/module.yml | head -2 | tail -1 | cut -d' ' -f1)
@@ -95,7 +101,7 @@ jobs:
95101
EOF
96102
97103
- name: Create or update comment (Pull Request)
98-
if: github.event_name == 'pull_request_target'
104+
if: github.event_name == 'pull_request'
99105
uses: actions/github-script@v7
100106
with:
101107
script: |

0 commit comments

Comments
 (0)