diff --git a/.github/workflows/measure_coverage.yml b/.github/workflows/measure_coverage.yml index baa4767fe..10fc8e97d 100644 --- a/.github/workflows/measure_coverage.yml +++ b/.github/workflows/measure_coverage.yml @@ -1,7 +1,20 @@ name: Measure coverage on: - pull_request_target: + pull_request: + types: [opened, synchronize, reopened] + +# cancel in-progress jobs if a new job is triggered +# This is useful to avoid running multiple builds for the same branch if a new commit is pushed +# or a pull request is updated. +# It helps to save resources and time by ensuring that only the latest commit is built and tested +# This is particularly useful for long-running jobs that may take a while to complete. +# The `group` is set to a combination of the workflow name, event name, and branch name. +# This ensures that jobs are grouped by the workflow and branch, allowing for cancellation of +# in-progress jobs when a new commit is pushed to the same branch or a new pull request is opened. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref_name || github.ref }} + cancel-in-progress: true permissions: contents: read @@ -55,4 +68,5 @@ jobs: ${{ github.workspace }}/**/build/reports/jacoco/test/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 10 - min-coverage-changed-files: 0 \ No newline at end of file + min-coverage-changed-files: 0 + comment-type: summary \ No newline at end of file