Skip to content

Commit 787e24f

Browse files
Refactor build workflows (#20)
* Refactor AI-assisted action execution to use matrix strategy * Refactor testing jobs to separate PR Summary and PR Review actions * Update AI model from gpt-4o to o3 in PR Summary and PR Review actions * Add permissions to jobs in workflow files for proper access control * Disable major updates for SAP/ai-assisted-github-actions in Renovate configuration * Update AI model to anthropic--claude-4-opus in PR Summary and PR Review actions; change model to o4-mini in build workflow * Update action versions for PR Summary and PR Review steps to v3 * Update AI model in PR Summary and PR Review actions to anthropic--claude-4-sonnet
1 parent 29bd614 commit 787e24f

File tree

5 files changed

+51
-9
lines changed

5 files changed

+51
-9
lines changed

.github/workflows/ai-assistance.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ jobs:
88
name: PR Summary
99
if: github.actor != 'ospo-renovate[bot]'
1010
runs-on: [ubuntu-latest]
11+
permissions:
12+
contents: read
13+
pull-requests: write
1114
steps:
12-
- uses: SAP/ai-assisted-github-actions/pr-summary@93162bffd6b396623ffa5b20e4666e427db88414 # v3.0.2
15+
- uses: SAP/ai-assisted-github-actions/pr-summary@v3
1316
with:
1417
aicore-service-key: ${{ secrets.AICORE_SERVICE_KEY }}
15-
model: gpt-4o
18+
model: anthropic--claude-4-sonnet
1619
exclude-files: package-lock.json
1720
display-mode: append
1821
header-text: "---"
@@ -21,9 +24,12 @@ jobs:
2124
name: PR Review
2225
if: github.actor != 'ospo-renovate[bot]'
2326
runs-on: [ubuntu-latest]
27+
permissions:
28+
contents: read
29+
pull-requests: write
2430
steps:
25-
- uses: SAP/ai-assisted-github-actions/pr-review@93162bffd6b396623ffa5b20e4666e427db88414 # v3.0.2
31+
- uses: SAP/ai-assisted-github-actions/pr-review@v3
2632
with:
2733
aicore-service-key: ${{ secrets.AICORE_SERVICE_KEY }}
28-
model: gpt-4o
34+
model: anthropic--claude-4-sonnet
2935
exclude-files: package-lock.json

.github/workflows/build-cleanup.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
clean-up:
1414
name: Clean up
1515
runs-on: [ubuntu-latest]
16+
permissions:
17+
contents: write
1618
steps:
1719
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
1820
with:

.github/workflows/build.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
name: Build and push artifacts to release branch
1717
runs-on: [ubuntu-latest]
1818
if: ${{ !startsWith(github.head_ref || github.ref_name, 'release/') }}
19+
permissions:
20+
contents: write
1921
steps:
2022
- name: Checkout source branch
2123
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -90,11 +92,14 @@ jobs:
9092
git commit -m "${{ github.event.number && format('PR-{0}', github.event.number) || join(github.event.commits.*.message, ', ') }}" || true
9193
git push
9294
93-
testing:
94-
name: Execute the AI-assisted action defined in this PR
95+
testing-summary:
96+
name: Execute the action (PR Summary) defined in this PR
9597
runs-on: [ubuntu-latest]
9698
needs: create-release
9799
if: ${{ github.ref_name != 'main' }}
100+
permissions:
101+
contents: read
102+
pull-requests: write
98103
steps:
99104
- name: Checkout release branch
100105
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -104,14 +109,28 @@ jobs:
104109
uses: ./pr-summary # action.yml is in the pr-summary folder of the release branch
105110
with:
106111
aicore-service-key: ${{ secrets.AICORE_SERVICE_KEY }}
107-
model: gpt-4o
112+
model: o4-mini
108113
exclude-files: package-lock.json
109114
display-mode: comment-delta
110-
- name: Run the AI-assisted action (PR Summary)
115+
116+
testing-review:
117+
name: Execute the action (PR Review) defined in this PR
118+
runs-on: [ubuntu-latest]
119+
needs: create-release
120+
if: ${{ github.ref_name != 'main' }}
121+
permissions:
122+
contents: read
123+
pull-requests: write
124+
steps:
125+
- name: Checkout release branch
126+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
127+
with:
128+
ref: ${{ env.RELEASE_BRANCH }}
129+
- name: Run the AI-assisted action (PR Review)
111130
uses: ./pr-review # action.yml is in the pr-review folder of the release branch
112131
with:
113132
aicore-service-key: ${{ secrets.AICORE_SERVICE_KEY }}
114-
model: gpt-4o
133+
model: o4-mini
115134
exclude-files: package-lock.json
116135
display-mode: review-comment-delta
117136

@@ -120,6 +139,8 @@ jobs:
120139
runs-on: [ubuntu-latest]
121140
needs: create-release
122141
if: ${{ github.ref_name == 'main' }}
142+
permissions:
143+
contents: write
123144
steps:
124145
- name: Checkout release branch
125146
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/code-quality.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
lintCheck:
1313
runs-on: [ubuntu-latest]
1414
name: Linter (${{ matrix.path }})
15+
permissions:
16+
contents: read
1517
strategy:
1618
fail-fast: false
1719
matrix:
@@ -35,6 +37,8 @@ jobs:
3537
formatCheck:
3638
runs-on: [ubuntu-latest]
3739
name: Formatter (${{ matrix.path }})
40+
permissions:
41+
contents: read
3842
strategy:
3943
fail-fast: false
4044
matrix:

.renovaterc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
"/^@?octokit//",
3030
"/^eslint$/"
3131
]
32+
},
33+
{
34+
"matchDepTypes": [
35+
"action"
36+
],
37+
"matchPackageNames": [
38+
"SAP/ai-assisted-github-actions"
39+
],
40+
"enabled": false
3241
}
3342
],
3443
"schedule": [

0 commit comments

Comments
 (0)