Skip to content

Commit aed2175

Browse files
committed
Merge branch 'main' of github.com:directedproject-eu/pygeoapi-mca-process
2 parents 52eb001 + 30c3c70 commit aed2175

3 files changed

Lines changed: 46 additions & 41 deletions

File tree

.github/workflows/build-pipeline.yaml

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
steps:
3131
-
3232
name: Checkout Repository
33-
uses: actions/checkout@v5
33+
uses: actions/checkout@v6
3434
-
3535
name: Set up Docker Buildkit env
36-
uses: docker/setup-buildx-action@v3
36+
uses: docker/setup-buildx-action@v4
3737
-
3838
name: Determine Branch or Tag
3939
id: determine
@@ -48,7 +48,7 @@ jobs:
4848
-
4949
name: Extract metadata (tags, labels) for tagging Docker Image
5050
id: meta
51-
uses: docker/metadata-action@v5
51+
uses: docker/metadata-action@v6
5252
with:
5353
images: "${{ env.IMAGE_TAG }}"
5454
labels: |
@@ -62,7 +62,7 @@ jobs:
6262
-
6363
name: Log in to Docker Hub
6464
if: github.event_name != 'pull_request'
65-
uses: docker/login-action@v3
65+
uses: docker/login-action@v4
6666
with:
6767
username: ${{ secrets.DOCKER_USERNAME }}
6868
password: ${{ secrets.DOCKER_TOKEN }}
@@ -80,7 +80,7 @@ jobs:
8080
# ruff format --diff
8181
-
8282
name: Build and push Docker image
83-
uses: docker/build-push-action@v6
83+
uses: docker/build-push-action@v7
8484
with:
8585
context: "${{ env.BUILD_CONTEXT }}"
8686
build-args: |
@@ -96,7 +96,8 @@ jobs:
9696
cache-to: type=gha
9797
-
9898
name: Run trivy vulnerability scanner
99-
uses: aquasecurity/trivy-action@master
99+
# get latest version from https://github.com/aquasecurity/trivy-action/releases
100+
uses: aquasecurity/trivy-action@v0.35.0
100101
env:
101102
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
102103
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
@@ -112,41 +113,43 @@ jobs:
112113
scanners: vuln,secret,misconfig
113114
severity: CRITICAL,HIGH
114115
-
115-
name: remove empty results
116-
run: |
117-
vulnerabilities=$(cat trivy-results.json | jq 'if (.Results | length) == 0 then 0 else [.Results[].Vulnerabilities | length] | add end'); \
118-
if [[ "$vulnerabilities" -eq 0 ]]; then \
119-
rm trivy-results.json
120-
fi
116+
name: remove empty results
117+
run: |
118+
vulnerabilities=$(cat trivy-results.json | jq 'if (.Results | length) == 0 then 0 else [.Results[].Vulnerabilities | length] | add end'); \
119+
if [[ "$vulnerabilities" -eq 0 ]]; then \
120+
rm trivy-results.json
121+
fi
121122
-
122-
if: ${{ hashFiles('trivy-results.json') != '' }}
123-
name: 2nd scan to create human readable report
124-
uses: aquasecurity/trivy-action@master
125-
env:
126-
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
127-
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
128-
TRIVY_DISABLE_VEX_NOTICE: disable_vex_notice
129-
TRIVY_FORMAT: table
130-
TRIVY_OUTPUT: trivy-results.txt
131-
with:
132-
image-ref: "${{ env.IMAGE_TAG }}"
133-
format: 'table'
134-
output: 'trivy-results.txt'
135-
exit-code: '0'
136-
ignore-unfixed: true
137-
vuln-type: 'os,library'
138-
severity: 'CRITICAL,HIGH'
123+
if: ${{ hashFiles('trivy-results.json') != '' }}
124+
name: 2nd scan to create human readable report
125+
# get latest version from https://github.com/aquasecurity/trivy-action/releases
126+
uses: aquasecurity/trivy-action@v0.35.0
127+
env:
128+
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
129+
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
130+
TRIVY_DISABLE_VEX_NOTICE: disable_vex_notice
131+
TRIVY_FORMAT: table
132+
TRIVY_OUTPUT: trivy-results.txt
133+
with:
134+
image-ref: "${{ env.IMAGE_TAG }}"
135+
format: 'table'
136+
output: 'trivy-results.txt'
137+
exit-code: '0'
138+
ignore-unfixed: true
139+
vuln-type: 'os,library'
140+
severity: 'CRITICAL,HIGH'
139141
-
140142
if: ${{ hashFiles('trivy-results.txt') != '' }}
141-
name: Upload to 52N slack
142-
uses: MeilCli/slack-upload-file@v4
143-
with:
144-
slack_token: ${{ secrets.SLACK_TOKEN }}
145-
file_path: trivy-results.txt
146-
file_type: text/plain
147-
title: trivy scan results of ${{ github.repository }}
148-
channel_id: ${{ secrets.SLACK_CHANNEL_ID_52N }}
149-
initial_comment: "Trivy Results for '${{ github.repository }}' uploaded. Please review: https://github.com/${{ github.repository }}/actions"
143+
name: Send Trivy Results to Google Chat
144+
env:
145+
WEBHOOK_URL: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
146+
REPO_NAME: ${{ github.repository }}
147+
REPO_URL: "https://github.com/${{ github.repository }}/actions"
148+
run: |
149+
CONTENT=$(cat trivy-results.txt | head -c 3800)
150+
MESSAGE="Trivy Results for '${REPO_NAME}':\n\n\`\`\`\n${TRIVY_CONTENT}\n\`\`\`\n\n(Results truncated) Please review full report at: ${REPO_URL}"
151+
JSON_PAYLOAD=$(jq -n --arg msg "$MESSAGE" '{text: $msg}')
152+
curl -X POST -H 'Content-Type: application/json' "$WEBHOOK_URL" -d "$JSON_PAYLOAD"
150153
#
151154
# BEFORE ACTIVATING the deployment trigger, configure the according secrets
152155
# -

.github/workflows/lint-and-format.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
steps:
1616
-
1717
name: Checkout Repository
18-
uses: actions/checkout@v5
18+
uses: actions/checkout@v6
1919
-
2020
name: Set up Python 3.11
21-
uses: actions/setup-python@v3
21+
uses: actions/setup-python@v6
2222
with:
2323
python-version: "3.11"
2424
-

.github/workflows/stale.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ on:
33
schedule:
44
# https://crontab.cronhub.io/
55
- cron: '52 4 * * Mon'
6+
permissions:
7+
issues: write
68
jobs:
79
stale:
810
runs-on: ubuntu-latest
911
steps:
10-
- uses: actions/stale@v9
12+
- uses: actions/stale@v10
1113
with:
1214
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
1315
days-before-stale: 60

0 commit comments

Comments
 (0)