Skip to content

Commit

Permalink
ci(github): update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Jul 30, 2024
1 parent 9dacbcf commit fa1e64b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 78 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/build-and-push-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@

name: Build and push OADA images

permissions:
packages: write
security-events: write
id-token: write
actions: read
checks: read
contents: read
deployments: read
issues: read
discussions: read
pages: read
pull-requests: read
repository-projects: read
statuses: read

on:
push:
pull_request:
Expand All @@ -40,7 +55,7 @@ jobs:
id: services
run: |
SERVICES=$(ls -1 oada/services | tr '\n' ',' | sed 's/,/","/g' | sed 's/^/["/' | sed 's/,"$/]/')
echo ::set-output name=list::${SERVICES}
echo list="${SERVICES}" >> "$GITHUB_OUTPUT"
- name: Parse Ref
id: ref
Expand Down Expand Up @@ -78,8 +93,8 @@ jobs:
exit 1
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=release::${RELEASE}
echo version="${VERSION}" >> "$GITHUB_OUTPUT"
echo release="${RELEASE}" >> "$GITHUB_OUTPUT"
- name: Parse Semver
id: semver
Expand Down Expand Up @@ -111,7 +126,6 @@ jobs:
version: latest

- name: Cache docker layers
if: ${{ !env.ACT }} # Awaiting ACT version after 0.2.17 for this feature
uses: actions/cache@v4
id: cache
with:
Expand Down Expand Up @@ -175,7 +189,6 @@ jobs:
version: latest

- name: Cache docker layers
if: ${{ !env.ACT }} # Awaiting ACT version after 0.2.17 for this feature
uses: actions/cache@v4
id: cache
with:
Expand All @@ -195,8 +208,8 @@ jobs:
# Name on GHCR
GHCR_IMAGE=ghcr.io/${OWNER}/${{ matrix.service}}
echo ::set-output name=dockerhub::${DOCKER_IMAGE}
echo ::set-output name=ghcr::${GHCR_IMAGE}
echo dockerhub="${DOCKER_IMAGE}" >> "$GITHUB_OUTPUT"
echo ghcr="${GHCR_IMAGE}" >> "$GITHUB_OUTPUT"
- name: Login to DockerHub
#if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -300,9 +313,9 @@ jobs:
fi
fi
echo ::set-output name=tag::${TAG}
echo ::set-output name=org::${OWNER}
echo ::set-output name=cur::${GHCR_IMAGE}:sha-${GITHUB_SHA::8}
echo tag="${TAG}" >> "$GITHUB_OUTPUT"
echo org="${OWNER}" >> "$GITHUB_OUTPUT"
echo cur="${GHCR_IMAGE}:sha-${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
- name: Monitor Service image with Snyk
uses: snyk/actions/docker@master
Expand All @@ -325,6 +338,11 @@ jobs:
image: ${{ steps.tag.outputs.tag }}
args: --org=${{ steps.tag.outputs.org }} --file=${{ matrix.context }}/Dockerfile

- name: Replace security-severity undefined for license-related findings
run: |
sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk.sarif
sed -i 's/"security-severity": "null"/"security-severity": "0"/g' snyk.sarif
- name: Secure Code Warrior
uses: SecureCodeWarrior/github-action-add-sarif-contextual-training@v1
with:
Expand Down Expand Up @@ -381,7 +399,7 @@ jobs:
RELEASE_VERSION="${{ needs.setup.outputs.version }}" \
./release/make.sh | tee $RELEASE
echo ::set-output name=composefile::$RELEASE
echo composefile="${RELEASE}" >> "$GITHUB_OUTPUT"
# TODO: More detailed check?
- name: Verify Compose File
Expand Down
67 changes: 0 additions & 67 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@

name: Release Helm charts

permissions: read-all

on:
push:
branches:
- master

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -35,6 +39,8 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v4
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
version: v3.8.1

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/semgrep-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

name: Semgrep

permissions: read-all

on:
# Scan changed files in PRs (diff-aware scanning):
pull_request: {}
Expand All @@ -24,6 +26,9 @@ jobs:
# If you are self-hosting, change the following `runs-on` value:
runs-on: ubuntu-latest

permissions:
security-events: write

container:
# A Docker image with Semgrep installed. Do not change this.
image: semgrep/semgrep
Expand All @@ -42,6 +47,7 @@ jobs:
# and add it to your GitHub secrets.
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
SEMGREP_DEPLOYMENT_ID: ${{ secrets.SEMGREP_DEPLOYMENT_ID }}
SEMGREP_SUPPRESS_ERRORS: true

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

0 comments on commit fa1e64b

Please sign in to comment.