Skip to content

Commit a73b18b

Browse files
committed
fix: ASH PR comment artifacts and dependabot auto-merge workflow
- Consolidate ASH scan artifacts into single directory for reliable download paths - Add debug logging to comment workflow for artifact verification - Switch dependabot workflow to pull_request_target trigger - Use github.actor for dependabot bot detection
1 parent a4dfbfe commit a73b18b

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

.github/workflows/ash-security-comment.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
run-id: ${{ github.event.workflow_run.id }}
2424
github-token: ${{ secrets.GITHUB_TOKEN }}
2525

26+
- name: Debug artifact contents
27+
run: |
28+
echo "Artifact contents:"
29+
find /tmp/ash-results -type f | head -20
30+
2631
- name: Get PR information
2732
id: pr-info
2833
run: |
@@ -49,6 +54,8 @@ jobs:
4954
script: |
5055
const fs = require('fs');
5156
const commentPath = '/tmp/ash-results/pr_comment.md';
57+
console.log('Looking for comment file at:', commentPath);
58+
console.log('File exists:', fs.existsSync(commentPath));
5259
5360
if (!fs.existsSync(commentPath)) {
5461
console.log('No comment file found in artifacts');

.github/workflows/ash-security-scan.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,25 +202,24 @@ jobs:
202202
echo "has_findings=false" >> "$GITHUB_OUTPUT"
203203
fi
204204
205-
- name: Save PR metadata
205+
- name: Prepare artifacts
206206
if: steps.changed-files.outputs.any_changed == 'true'
207207
env:
208208
PR_NUMBER: ${{ github.event.pull_request.number }}
209209
PR_SHA: ${{ github.event.pull_request.head.sha }}
210210
run: |
211-
echo "${PR_NUMBER}" > /tmp/pr_number.txt
212-
echo "${PR_SHA}" > /tmp/pr_sha.txt
211+
mkdir -p /tmp/ash-artifacts
212+
echo "${PR_NUMBER}" > /tmp/ash-artifacts/pr_number.txt
213+
echo "${PR_SHA}" > /tmp/ash-artifacts/pr_sha.txt
214+
cp /tmp/pr_comment.md /tmp/ash-artifacts/pr_comment.md
215+
cp -r /tmp/ash-scan/.ash/ /tmp/ash-artifacts/.ash/ 2>/dev/null || true
213216
214217
- name: Upload ASH results and PR metadata
215218
if: steps.changed-files.outputs.any_changed == 'true' && always()
216219
uses: actions/upload-artifact@v4
217220
with:
218221
name: ash-security-results
219-
path: |
220-
/tmp/ash-scan/.ash/
221-
/tmp/pr_comment.md
222-
/tmp/pr_number.txt
223-
/tmp/pr_sha.txt
222+
path: /tmp/ash-artifacts/
224223
retention-days: 30
225224

226225
- name: Security scan summary

.github/workflows/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Dependabot auto-merge
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize]
4+
pull_request_target:
5+
types: [opened, synchronize, reopened]
66

77
permissions:
88
pull-requests: write
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
dependabot:
1313
runs-on: ubuntu-latest
14-
if: github.event.pull_request.user.login == 'dependabot[bot]'
14+
if: github.actor == 'dependabot[bot]'
1515
steps:
1616
- name: Dependabot metadata
1717
id: metadata

0 commit comments

Comments
 (0)