Skip to content

Commit 011d6b1

Browse files
committed
soups - check dependency changes and generate missing
1 parent fef8d10 commit 011d6b1

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

.github/workflows/soup-approval-verification-workflow.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
id: fetch-soup-files
3131
shell: bash
3232
run: |
33-
JSON_FILES=$(git diff --name-only --diff-filter=AM "origin/$BASE_BRANCH" -- soups/**/*.json || true)
33+
JSON_FILES=$(git diff --name-only --diff-filter=AM "origin/$BASE_BRANCH" -- .soups/**/*.json || true)
3434
if [ -z "$JSON_FILES" ]; then
35-
echo "::error::No JSON files changed in this PR"
36-
exit 1
35+
echo "No JSON files changed in this PR"
36+
exit 0
3737
fi
3838
3939
echo "Found JSON files in PR: $JSON_FILES"
@@ -168,9 +168,9 @@ jobs:
168168
done
169169
170170
if [ "$APPROVER_FOUND" = false ]; then
171-
echo "❌ $APPROVED_BY is not in the allowed approvers list: $ALLOWED_APPROVERS"
171+
echo "::error::❌ $APPROVED_BY is not in the allowed approvers list: $ALLOWED_APPROVERS"
172172
echo "Approval will not be recorded."
173-
exit 0
173+
exit 1
174174
fi
175175
176176
echo "✅ $APPROVED_BY is authorized to approve soups"
@@ -180,7 +180,7 @@ jobs:
180180
181181
APPROVED_ON=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
182182
183-
for FILE in $JSON_FILES; do
183+
for FILE in $SOUP_FILES; do
184184
if [ ! -f "$FILE" ]; then
185185
echo "File $FILE not found, skipping"
186186
continue
@@ -204,6 +204,6 @@ jobs:
204204
exit 0
205205
fi
206206
207-
git add soups/*.json
207+
git add .soups/*.json
208208
git commit -m "Update approval information: approved by ${{ github.event.review.user.login }}"
209209
git push origin HEAD
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: SOUP - Check Changes and Generate Missing
2+
env:
3+
GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }}
4+
5+
on:
6+
workflow_call:
7+
jobs:
8+
generate-missing:
9+
runs-on: [self-hosted, Linux]
10+
steps:
11+
- uses: QuickBirdEng/actions/checkout-ssh@main
12+
with:
13+
ssh-private-key: ${{ secrets.CI_SSH_PRIVATE_KEY_FOR_GITHUB_PRIVATE_REPOS }}
14+
- name: Check for Changes and Generate Missing SOUPs
15+
uses: QuickBirdEng/actions/soup-check-changes-and-generate@main
16+
with:
17+
repository: ${{ github.event.repository.name }}
18+
gh-api-token: ${{ env.GH_API_TOKEN }}
19+
soup-approvers: ${{ vars.SOUP_APPROVERS }}
20+
base-branch: origin/${{ github.event.pull_request.base.ref || 'main' }}

.github/workflows/soup-cve-check-workflow.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: SOUP - CVE Check
22
on:
3-
workflow_dispatch:
3+
workflow_call:
44
inputs:
55
type:
66
description: 'Type of package manager'
77
required: true
8-
type: choice
9-
options: ['Pub', 'npm']
8+
type: string
109
package:
1110
description: 'Name of the package'
1211
required: true
@@ -25,9 +24,9 @@ jobs:
2524
- uses: QuickBirdEng/actions/checkout-ssh@main
2625
with:
2726
ssh-private-key: ${{ secrets.CI_SSH_PRIVATE_KEY_FOR_GITHUB_PRIVATE_REPOS }}
28-
- name: JQ Version
29-
shell: bash
30-
run: jq --version
3127
- name: Check CVE
32-
shell: bash
33-
run: bash cve-check.sh "${{ inputs.type }}" "${{ inputs.package }}" "${{ inputs.version }}" false
28+
uses: QuickBirdEng/actions/soup-cve-check@main
29+
with:
30+
type: ${{ inputs.type }}
31+
package: ${{ inputs.package }}
32+
version: ${{ inputs.version }}

0 commit comments

Comments
 (0)