From 3a4564239a49695260086556e8d4b68c3884eb6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Tue, 9 May 2023 10:50:09 +0200 Subject: [PATCH 1/3] Perform automatic PR and commit to framework --- .github/workflows/frameworkPR.yml | 30 +++++++++++++++++++++++ .github/workflows/frameworkValidation.yml | 23 ----------------- 2 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/frameworkPR.yml delete mode 100644 .github/workflows/frameworkValidation.yml diff --git a/.github/workflows/frameworkPR.yml b/.github/workflows/frameworkPR.yml new file mode 100644 index 00000000..1debc65b --- /dev/null +++ b/.github/workflows/frameworkPR.yml @@ -0,0 +1,30 @@ +name: Framework pull request + +on: + pull_request: + branches: [ "master" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +defaults: + run: + shell: bash + +jobs: + framework-PR: + runs-on: ubuntu-latest + steps: + - uses: rest-for-physics/framework/.github/actions/submodulePR@submodule-PR + with: + branch: ${{ env.BRANCH_NAME }} + submodule: source/libraries/detector + token: ${{ secrets.REST_TOKEN }} + label: detectorlib-pr diff --git a/.github/workflows/frameworkValidation.yml b/.github/workflows/frameworkValidation.yml deleted file mode 100644 index 577a7362..00000000 --- a/.github/workflows/frameworkValidation.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Framework Validation - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - release: - - workflow_dispatch: - -env: - CMAKE_BUILD_TYPE: Release - REST_PATH: /rest/detectorlib/install - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - -defaults: - run: - shell: bash - -jobs: - framework-validation: - uses: rest-for-physics/framework/.github/workflows/validation.yml@master From cb6d71acbb686f944909711bb447351d28a6f02f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Tue, 9 May 2023 10:54:16 +0200 Subject: [PATCH 2/3] New workflow to check if the framework-pr label is present --- .github/workflows/frameworkmerge.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/frameworkmerge.yml diff --git a/.github/workflows/frameworkmerge.yml b/.github/workflows/frameworkmerge.yml new file mode 100644 index 00000000..64c77fa8 --- /dev/null +++ b/.github/workflows/frameworkmerge.yml @@ -0,0 +1,17 @@ +name: "Merge PR from framework is required" + +on: + pull_request: + types: [ "opened", "reopened", "created", "closed", "synchronize", "labeled", "unlabeled"] +# Allows you to run this workflow manually from the Actions tab + workflow_dispatch: +jobs: + label-check: + runs-on: ubuntu-latest + steps: + - name: Check label + if: "contains(github.event.pull_request.labels.*.name, 'framework-pr')" + run: | + echo "framework-pr label is present and this PR can only be merged from framework" + exit 1 + shell: bash From 17ce8e48562d278c0baf3ac0369b911a3d122a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Fri, 19 May 2023 09:57:38 +0200 Subject: [PATCH 3/3] Update pr-badge.yml --- .github/pr-badge.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pr-badge.yml b/.github/pr-badge.yml index 2fbd97cd..0d23cddc 100644 --- a/.github/pr-badge.yml +++ b/.github/pr-badge.yml @@ -13,5 +13,5 @@ message: "Ok: $additions" color: "green" when: "$additions < 100" -- imageUrl: "https://github.com/rest-for-physics/detectorlib/actions/workflows/validation.yml/badge.svg?branch=$branchName" - url: "https://github.com/rest-for-physics/detectorlib/commits/$branchName" +- imageUrl: "https://github.com/rest-for-physics/framework/actions/workflows/validation.yml/badge.svg?branch=$branchName" + url: "https://github.com/rest-for-physics/framework/commits/$branchName"