Skip to content

Commit

Permalink
chore(ci): prevent duplicate ci triggers
Browse files Browse the repository at this point in the history
Triggering on all 'push' and 'pull_request' events will result in
duplicated CI runs in PRs (due to both conditions being met).

Instead, trigger only on pushes to `master`, or updates to PRs
targetting `master`.

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Jan 9, 2025
1 parent 15c7c37 commit 0bc33c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Audit
on:
workflow_dispatch:
push:
branches:
- master
schedule:
- cron: 0 0 * * 4 # Midnight Wednesday

Expand All @@ -14,7 +16,7 @@ jobs:
matrix:
DOCKER_TARGET_PLATFORM: [
# linux/arm, # Disabled whilst waiting for next release of trivy with published arm artefacts
linux/arm64,
linux/arm64,
linux/amd64
]
runs-on: ubuntu-latest
Expand All @@ -27,4 +29,4 @@ jobs:
if: ${{ matrix.DOCKER_TARGET_PLATFORM }} == 'linux/arm' || 'linux/arm64'
run: ./script/release-workflow/docker-prepare.sh
- name: Audit Docker image for ${{ matrix.DOCKER_TARGET_PLATFORM }}
run: ./script/release-workflow/audit.sh
run: ./script/release-workflow/audit.sh
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Test

on: [push, pull_request, workflow_dispatch]
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

jobs:
test:
Expand All @@ -23,7 +30,7 @@ jobs:
node: [ 16, 18, 20 ]
steps:
- uses: actions/checkout@v4


- name: Login to Docker Hub
run: script/release-workflow/docker-login.sh
Expand Down

0 comments on commit 0bc33c7

Please sign in to comment.