Skip to content

Commit 45cc0c2

Browse files
Update gemini_issues_review.yml
1 parent f121234 commit 45cc0c2

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/gemini_issues_review.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
11
name: Gemini AI Issue Summarizer
22

33
on:
4-
# This workflow now triggers when a new issue is opened
4+
# Triggers when a new issue is opened or an existing issue body/title is edited
55
issues:
6-
types: [opened]
6+
types: [opened, edited]
77

88
jobs:
99
summarize:
10-
# Ensure the job only runs for new issues and not from the bot itself
11-
if: github.event.issue.author.login != 'github-actions[bot]'
10+
# Skip events triggered by the bot itself; for edits, only process body/title changes
11+
if: |
12+
github.actor != 'github-actions[bot]' &&
13+
(github.event.action == 'opened' ||
14+
(github.event.action == 'edited' && (github.event.changes.body != null || github.event.changes.title != null)))
1215
runs-on: ubuntu-latest
1316
permissions:
1417
contents: read
1518
issues: write
1619

1720
steps:
1821
- name: Checkout repository
19-
uses: actions/checkout@v6
22+
uses: actions/checkout@v4
2023

2124
- name: Set up Node.js
2225
uses: actions/setup-node@v4
2326
with:
2427
node-version: '20'
2528

29+
- name: Cache node modules
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.npm
33+
key: ${{ runner.os }}-gemini-issues-${{ hashFiles('.github/scripts/review.js') }}
34+
restore-keys: |
35+
${{ runner.os }}-gemini-issues-
36+
2637
- name: Install dependencies
2738
run: npm install @actions/github @google/generative-ai @octokit/core
2839

0 commit comments

Comments
 (0)