From 926aeac21ce66a83bd901a5c7f446f90c40e5de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Wed, 17 May 2023 11:23:33 +0200 Subject: [PATCH 1/3] Automatic PR to framework --- .github/workflows/frameworkPR.yml | 30 +++++++++++++++++++++++ .github/workflows/frameworkValidation.yml | 24 ------------------ 2 files changed, 30 insertions(+), 24 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..b8f34455 --- /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/packages/restG4 + token: ${{ secrets.REST_TOKEN }} + label: restG4-pr diff --git a/.github/workflows/frameworkValidation.yml b/.github/workflows/frameworkValidation.yml deleted file mode 100644 index 6cabb867..00000000 --- a/.github/workflows/frameworkValidation.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Framework Validation - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - release: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - CMAKE_BUILD_TYPE: Release - REST_PATH: /rest/restG4/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@validation_framework From 150db527ed12899824afac61993ca1ba1fd33e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Wed, 17 May 2023 11:27:07 +0200 Subject: [PATCH 2/3] New workflow to check if PR can be merged from framework --- .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 c6781533c64e0c940d8eef645bd24605939d1c86 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 10:08:04 +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 bd4445de..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/restG4/actions/workflows/validation.yml/badge.svg?branch=$branchName" - url: "https://github.com/rest-for-physics/restG4/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"