From 666dec33a7eae0495b86736a9a0932cf0a3fefb4 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:51:46 +0100 Subject: [PATCH] Allow to run CI on external contributions (#254) (#255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mario Dominguez (cherry picked from commit abf6c9a52ccf6ad054578d07c5dd1a99121a9cec) Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com> --- .github/workflows/reusable-ci.yml | 7 ++++++- .github/workflows/ubuntu-ci.yml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index c99cefda..4b69f6fc 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -47,6 +47,11 @@ on: required: false type: boolean default: false + add-label: + description: 'Add the ci-pending label to the PR' + required: false + type: boolean + default: false env: toolset: ${{ inputs.vs-toolset && format('-T {0}', inputs.vs-toolset) || '' }} defaults: @@ -65,7 +70,7 @@ jobs: steps: - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' && inputs.add-label == true}} uses: eProsima/eProsima-CI/external/add_labels@v0 with: labels: ci-pending diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index ef3f4c33..0c0eb865 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -63,3 +63,4 @@ jobs: run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} use-ccache: ${{ inputs.use-ccache || false }} + add-label: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.repository) && true || false }}