Skip to content

Commit 74da6a1

Browse files
committed
fix: Add debug output to module monitor workflow for troubleshooting
1 parent 573e0c2 commit 74da6a1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/module-monitor.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
fetch-depth: 0
2424
persist-credentials: false
2525

26+
- name: Fetch PR head
27+
if: github.event_name == 'pull_request_target'
28+
run: |
29+
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-head
30+
2631
- name: Set up Python
2732
uses: actions/setup-python@v5
2833
with:
@@ -40,10 +45,15 @@ jobs:
4045
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha || '' }}
4146
run: |
4247
# For pull requests, compare with base branch
43-
if [ "$GITHUB_EVENT_NAME" = "pull_request_target" ]; then
48+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
4449
BASE_REF="$GITHUB_BASE_SHA"
4550
HEAD_REF="$GITHUB_HEAD_SHA"
51+
echo "DEBUG: Comparing $BASE_REF to $HEAD_REF" >&2
52+
echo "DEBUG: Current HEAD is $(git rev-parse HEAD)" >&2
53+
echo "DEBUG: Available commits:" >&2
54+
git log --oneline -5 >&2
4655
DIFF_OUTPUT=$(git diff $BASE_REF $HEAD_REF -- zephyr/module.yml || echo "No changes found")
56+
echo "DEBUG: Diff result: $DIFF_OUTPUT" >&2
4757
else
4858
# For push events, get the previous commit that modified module.yml
4959
PREV_COMMIT=$(git log --oneline --follow -- zephyr/module.yml | head -2 | tail -1 | cut -d' ' -f1)
@@ -95,7 +105,7 @@ jobs:
95105
EOF
96106
97107
- name: Create or update comment (Pull Request)
98-
if: github.event_name == 'pull_request_target'
108+
if: github.event_name == 'pull_request'
99109
uses: actions/github-script@v7
100110
with:
101111
script: |

0 commit comments

Comments
 (0)