From f4332c9de2d6e4907d5fdba3fd570f086ead4c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Mon, 15 May 2023 10:27:26 +0200 Subject: [PATCH 1/3] Automatic PR to framework --- .github/workflows/frameworkPR.yml | 31 +++++++++++++++++++++++ .github/workflows/frameworkValidation.yml | 23 ----------------- 2 files changed, 31 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 0000000..d2034b3 --- /dev/null +++ b/.github/workflows/frameworkPR.yml @@ -0,0 +1,31 @@ + +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/legacy + token: ${{ secrets.REST_TOKEN }} + label: legacylib-pr diff --git a/.github/workflows/frameworkValidation.yml b/.github/workflows/frameworkValidation.yml deleted file mode 100644 index 68d1011..0000000 --- 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/legacylib/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 bdb9b5d12ee536d134b1ba7a30a242222878aed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Garc=C3=ADa?= <80903717+juanangp@users.noreply.github.com> Date: Mon, 15 May 2023 10:31:05 +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 0000000..64c77fa --- /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 35998e031d74f6acf2dd526d175df2daf4de5861 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:06:00 +0200 Subject: [PATCH 3/3] Create pr-badge.yml --- .github/pr-badge.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/pr-badge.yml diff --git a/.github/pr-badge.yml b/.github/pr-badge.yml new file mode 100644 index 0000000..0d23cdd --- /dev/null +++ b/.github/pr-badge.yml @@ -0,0 +1,17 @@ +- label: "PR submitted by:" + message: "$payload.pull_request.user.login" + color: "blue" +- label: "PR Size" + message: "Large: $additions" + color: "red" + when: "$additions > 250" +- label: "PR Size" + message: "Medium: $additions" + color: "orange" + when: "$additions > 99 && $additions < 251" +- label: "PR Size" + message: "Ok: $additions" + color: "green" + when: "$additions < 100" +- 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"