ci: prevent duplicate workflow runs (#1324)

## Summary
- Restrict `push` trigger to `master` branch only (feature branch pushes
won't trigger CI)
- Add concurrency groups to cancel redundant runs when new commits are
pushed
- Works correctly with fork PRs using standard `pull_request` event
This commit is contained in:
Stanislas
2025-12-09 19:47:02 +01:00
committed by GitHub
parent 8bd0c73f8f
commit 66890fb5d3
2 changed files with 14 additions and 1 deletions

View File

@@ -1,11 +1,16 @@
---
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
name: Docker Test
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read

View File

@@ -1,7 +1,15 @@
on: [push, pull_request, workflow_dispatch]
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
name: Lint
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read