Skip to content

Commit fa1e64b

Browse files
committed
ci(github): update workflows
1 parent 9dacbcf commit fa1e64b

File tree

4 files changed

+41
-78
lines changed

4 files changed

+41
-78
lines changed

.github/workflows/build-and-push-services.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414

1515
name: Build and push OADA images
1616

17+
permissions:
18+
packages: write
19+
security-events: write
20+
id-token: write
21+
actions: read
22+
checks: read
23+
contents: read
24+
deployments: read
25+
issues: read
26+
discussions: read
27+
pages: read
28+
pull-requests: read
29+
repository-projects: read
30+
statuses: read
31+
1732
on:
1833
push:
1934
pull_request:
@@ -40,7 +55,7 @@ jobs:
4055
id: services
4156
run: |
4257
SERVICES=$(ls -1 oada/services | tr '\n' ',' | sed 's/,/","/g' | sed 's/^/["/' | sed 's/,"$/]/')
43-
echo ::set-output name=list::${SERVICES}
58+
echo list="${SERVICES}" >> "$GITHUB_OUTPUT"
4459
4560
- name: Parse Ref
4661
id: ref
@@ -78,8 +93,8 @@ jobs:
7893
exit 1
7994
fi
8095
81-
echo ::set-output name=version::${VERSION}
82-
echo ::set-output name=release::${RELEASE}
96+
echo version="${VERSION}" >> "$GITHUB_OUTPUT"
97+
echo release="${RELEASE}" >> "$GITHUB_OUTPUT"
8398
8499
- name: Parse Semver
85100
id: semver
@@ -111,7 +126,6 @@ jobs:
111126
version: latest
112127

113128
- name: Cache docker layers
114-
if: ${{ !env.ACT }} # Awaiting ACT version after 0.2.17 for this feature
115129
uses: actions/cache@v4
116130
id: cache
117131
with:
@@ -175,7 +189,6 @@ jobs:
175189
version: latest
176190

177191
- name: Cache docker layers
178-
if: ${{ !env.ACT }} # Awaiting ACT version after 0.2.17 for this feature
179192
uses: actions/cache@v4
180193
id: cache
181194
with:
@@ -195,8 +208,8 @@ jobs:
195208
# Name on GHCR
196209
GHCR_IMAGE=ghcr.io/${OWNER}/${{ matrix.service}}
197210
198-
echo ::set-output name=dockerhub::${DOCKER_IMAGE}
199-
echo ::set-output name=ghcr::${GHCR_IMAGE}
211+
echo dockerhub="${DOCKER_IMAGE}" >> "$GITHUB_OUTPUT"
212+
echo ghcr="${GHCR_IMAGE}" >> "$GITHUB_OUTPUT"
200213
201214
- name: Login to DockerHub
202215
#if: github.event_name != 'pull_request'
@@ -300,9 +313,9 @@ jobs:
300313
fi
301314
fi
302315
303-
echo ::set-output name=tag::${TAG}
304-
echo ::set-output name=org::${OWNER}
305-
echo ::set-output name=cur::${GHCR_IMAGE}:sha-${GITHUB_SHA::8}
316+
echo tag="${TAG}" >> "$GITHUB_OUTPUT"
317+
echo org="${OWNER}" >> "$GITHUB_OUTPUT"
318+
echo cur="${GHCR_IMAGE}:sha-${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
306319
307320
- name: Monitor Service image with Snyk
308321
uses: snyk/actions/docker@master
@@ -325,6 +338,11 @@ jobs:
325338
image: ${{ steps.tag.outputs.tag }}
326339
args: --org=${{ steps.tag.outputs.org }} --file=${{ matrix.context }}/Dockerfile
327340

341+
- name: Replace security-severity undefined for license-related findings
342+
run: |
343+
sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk.sarif
344+
sed -i 's/"security-severity": "null"/"security-severity": "0"/g' snyk.sarif
345+
328346
- name: Secure Code Warrior
329347
uses: SecureCodeWarrior/github-action-add-sarif-contextual-training@v1
330348
with:
@@ -381,7 +399,7 @@ jobs:
381399
RELEASE_VERSION="${{ needs.setup.outputs.version }}" \
382400
./release/make.sh | tee $RELEASE
383401
384-
echo ::set-output name=composefile::$RELEASE
402+
echo composefile="${RELEASE}" >> "$GITHUB_OUTPUT"
385403
386404
# TODO: More detailed check?
387405
- name: Verify Compose File

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/helm-chart.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414

1515
name: Release Helm charts
1616

17+
permissions: read-all
18+
1719
on:
1820
push:
1921
branches:
2022
- master
2123

2224
jobs:
2325
release:
26+
permissions:
27+
contents: write
2428
runs-on: ubuntu-latest
2529
steps:
2630
- name: Checkout
@@ -35,6 +39,8 @@ jobs:
3539
3640
- name: Install Helm
3741
uses: azure/setup-helm@v4
42+
env:
43+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
3844
with:
3945
version: v3.8.1
4046

.github/workflows/semgrep-analysis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
name: Semgrep
77

8+
permissions: read-all
9+
810
on:
911
# Scan changed files in PRs (diff-aware scanning):
1012
pull_request: {}
@@ -24,6 +26,9 @@ jobs:
2426
# If you are self-hosting, change the following `runs-on` value:
2527
runs-on: ubuntu-latest
2628

29+
permissions:
30+
security-events: write
31+
2732
container:
2833
# A Docker image with Semgrep installed. Do not change this.
2934
image: semgrep/semgrep
@@ -42,6 +47,7 @@ jobs:
4247
# and add it to your GitHub secrets.
4348
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
4449
SEMGREP_DEPLOYMENT_ID: ${{ secrets.SEMGREP_DEPLOYMENT_ID }}
50+
SEMGREP_SUPPRESS_ERRORS: true
4551

4652
- name: Secure Code Warrior
4753
uses: SecureCodeWarrior/github-action-add-sarif-contextual-training@v1

0 commit comments

Comments
 (0)