Skip to content

Commit c2c8492

Browse files
authored
tests
1 parent be052a8 commit c2c8492

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
lines changed

.github/workflows/gemini-assistant.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ jobs:
154154
USER_COMMAND: ${{ steps.extract-command.outputs.command }}
155155
ISSUE_NUMBER: ${{ github.event.issue.number }}
156156
with:
157+
github-token: ${{ secrets.GITHUB_TOKEN }}
157158
script: |
158159
const fs = require('fs');
159160
const commentUser = process.env.COMMENT_USER;
@@ -212,3 +213,7 @@ jobs:
212213
repo: context.repo.repo,
213214
body: aiResponse
214215
});
216+
owner: context.repo.owner,
217+
repo: context.repo.repo,
218+
body: aiResponse
219+
});

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ permissions:
2020
contents: read
2121
issues: write
2222
pull-requests: write
23+
actions: read
2324

2425
jobs:
2526
security-scan:
@@ -95,6 +96,7 @@ jobs:
9596
env:
9697
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
9798
with:
99+
github-token: ${{ secrets.GITHUB_TOKEN }}
98100
script: |
99101
const fs = require('fs');
100102
const changedFiles = process.env.CHANGED_FILES;
@@ -136,13 +138,23 @@ jobs:
136138
**Workflow Run:** ${context.payload.repository.html_url}/actions/runs/${context.runId}
137139
`;
138140
139-
await github.rest.issues.create({
140-
owner: context.repo.owner,
141-
repo: context.repo.repo,
142-
title: title,
143-
body: body,
144-
labels: ['security-analysis', 'ai-generated', 'needs-review']
145-
});
141+
// Create issue for security analysis
142+
try {
143+
await github.rest.issues.create({
144+
owner: context.repo.owner,
145+
repo: context.repo.repo,
146+
title: title,
147+
body: body,
148+
labels: ['security-analysis', 'ai-generated', 'needs-review']
149+
});
150+
console.log('✅ Security analysis issue created successfully');
151+
} catch (error) {
152+
console.log('⚠️ Could not create issue, writing to workflow summary instead');
153+
await core.summary
154+
.addHeading('🔒 Security Analysis Report')
155+
.addRaw(body)
156+
.write();
157+
}
146158
147159
- name: Create Security Issue on Critical Findings
148160
if: failure()

.github/workflows/wordpress-standards-check.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ concurrency:
1717

1818
permissions:
1919
contents: read
20+
issues: write
2021
pull-requests: write
22+
actions: read
2123

2224
jobs:
2325
wordpress-standards-check:
@@ -119,6 +121,7 @@ jobs:
119121
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
120122
FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }}
121123
with:
124+
github-token: ${{ secrets.GITHUB_TOKEN }}
122125
script: |
123126
const fs = require('fs');
124127
const changedFiles = process.env.CHANGED_FILES;
@@ -168,13 +171,22 @@ jobs:
168171
`;
169172
170173
// Create issue for standards review
171-
await github.rest.issues.create({
172-
owner: context.repo.owner,
173-
repo: context.repo.repo,
174-
title: title,
175-
body: body,
176-
labels: ['code-standards', 'wordpress', 'ai-generated', 'needs-review']
177-
});
174+
try {
175+
await github.rest.issues.create({
176+
owner: context.repo.owner,
177+
repo: context.repo.repo,
178+
title: title,
179+
body: body,
180+
labels: ['code-standards', 'wordpress', 'ai-generated', 'needs-review']
181+
});
182+
console.log('✅ Standards analysis issue created successfully');
183+
} catch (error) {
184+
console.log('⚠️ Could not create issue, writing to workflow summary instead');
185+
await core.summary
186+
.addHeading('📋 WordPress Standards Review')
187+
.addRaw(body)
188+
.write();
189+
}
178190
179191
- name: Comment on PR with Findings
180192
if: github.event_name == 'pull_request'

0 commit comments

Comments
 (0)