Skip to content

Commit

Permalink
feat: analysis revision (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Oct 13, 2023
1 parent d603825 commit 5d2b0ba
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: Analysis
on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
# schedule:
# - cron: "0 11 * * 0" # 3 AM PST = 12 PM UDT, runs sundays
schedule: [cron: "0 11 * * 0"] # 3 AM PST = 12 PM UDT, runs sundays
workflow_call:
workflow_dispatch:

concurrency:
Expand All @@ -16,8 +14,7 @@ concurrency:
jobs:
# https://github.com/marketplace/actions/aqua-security-trivy
trivy:
name: Trivy Security Scan
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Trivy
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/pr-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR Closed

on:
pull_request:
branches: [main]
types: [closed]

concurrency:
# PR open and close use the same group, allowing only one at a time
group: pr-${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true

jobs:
ghcr-cleanup:
runs-on: ubuntu-22.04
strategy:
matrix:
package: [bitnami/postgresql, postgres/postgres]
steps:
- uses: actions/delete-package-versions@v4
with:
package-name: ${{ github.event.repository.name }}/${{ matrix.package }}
package-type: 'container'
min-versions-to-keep: 50
delete-only-untagged-versions: 'true'
26 changes: 4 additions & 22 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
# https://github.com/bcgov-nr/action-builder-ghcr
builds:
Builds:
if: "!github.event.pull_request.head.repo.fork"
permissions:
packages: write
Expand All @@ -39,24 +39,6 @@ jobs:
token: ${{ github.token }}
triggers: ${{ matrix.package}}/${{ matrix.triggers }}

ghcr-cleanup:
needs: [builds]
runs-on: ubuntu-22.04
strategy:
matrix:
package: [bitnami/postgresql, postgres/postgres]
steps:
- uses: actions/delete-package-versions@v4
with:
package-name: ${{ github.event.repository.name }}/${{ matrix.package }}
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'

wrap-up:
needs: [ghcr-cleanup]
runs-on: ubuntu-22.04
steps:
- name: Wrap-up
run: |
echo "Dummy step for workflow completion"
Analysis:
needs: [Builds]
uses: ./.github/workflows/analysis.yml

0 comments on commit 5d2b0ba

Please sign in to comment.