From 5737acbb6670a5e61a438aa3a47cd4a63ffbd12c Mon Sep 17 00:00:00 2001 From: Ernesto Alejandro Santana Hidalgo Date: Fri, 10 Jan 2025 08:55:42 +0100 Subject: [PATCH] chore: enhance GitHub Actions workflow Added concurrency config to build workflow to manage job execution and prevent overlapping runs for pull requests, improving CI/CD efficiency. Signed-off-by: Ernesto Alejandro Santana Hidalgo --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 135beb8d..4141eea5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,15 @@ name: Go Modules Test on: [push, pull_request] +# https://docs.github.com/en/actions/learn-github-actions/expressions +# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context +concurrency: + # Use github.run_id on main branch + # Use github.event.pull_request.number on pull requests, so it's unique per pull request + # Use github.ref on other branches, so it's unique per branch + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: prepare-matrix: runs-on: ubuntu-latest