From 114a8edb19ed410f6efd0c7ba9a5f10d53413fb0 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:50:30 +0100 Subject: [PATCH 01/14] Create pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/pr-on-branch-push.yml diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml new file mode 100644 index 0000000..ac6b7b1 --- /dev/null +++ b/.github/workflows/pr-on-branch-push.yml @@ -0,0 +1,27 @@ +name: Pull Request on Push to branch +on: + push: + branches-ignore: + - main + - dev + +jobs: + create-pull-request: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: dev + + - name: Create PR + run: gh pr create -B $BASE_BRANCH -H $BRANCH_TO_MERGE --title $PR_TITLE --body $PR_BODY + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_TITLE: "Autocreated PR" + PR_BODY: "Created by Github action" + BASE_BRANCH: "dev" + BRANCH_TO_MERGE: $GITHUB_REF + + From e2c9f492eb788d260bc39ba52a497f8a970855a5 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:02:18 +0100 Subject: [PATCH 02/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index ac6b7b1..6debecc 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -16,12 +16,12 @@ jobs: ref: dev - name: Create PR - run: gh pr create -B $BASE_BRANCH -H $BRANCH_TO_MERGE --title $PR_TITLE --body $PR_BODY + run: gh pr create -B $BASE_BRANCH -H $BRANCH_TO_MERGE --title "tevd" --body "heiueh" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_TITLE: "Autocreated PR" PR_BODY: "Created by Github action" BASE_BRANCH: "dev" - BRANCH_TO_MERGE: $GITHUB_REF + BRANCH_TO_MERGE: ${{ github.ref}} From 3973cf98e95f76e5fb547b9db5d4f5ea829e470a Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:13:28 +0100 Subject: [PATCH 03/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index 6debecc..bf8d9fa 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -16,12 +16,13 @@ jobs: ref: dev - name: Create PR - run: gh pr create -B $BASE_BRANCH -H $BRANCH_TO_MERGE --title "tevd" --body "heiueh" + run: gh pr create -B $BASE_BRANCH -H $BRANCH_TO_MERGE --title "$PR_TITLE" --body "$PR_BODY" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_TITLE: "Autocreated PR" + PR_TITLE: "Autocreated PR: ${BRANCH_NAME}" PR_BODY: "Created by Github action" BASE_BRANCH: "dev" BRANCH_TO_MERGE: ${{ github.ref}} + BRANCH_NAME: ${{ github.ref_name}} From 7d05d824bc2d34b1c01096095f25ecfc1725c262 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:21:28 +0100 Subject: [PATCH 04/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index bf8d9fa..1118252 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -19,10 +19,9 @@ jobs: run: gh pr create -B $BASE_BRANCH -H $BRANCH_TO_MERGE --title "$PR_TITLE" --body "$PR_BODY" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_TITLE: "Autocreated PR: ${BRANCH_NAME}" + PR_TITLE: "Autocreated PR: ${{ github.ref_name}}" PR_BODY: "Created by Github action" BASE_BRANCH: "dev" BRANCH_TO_MERGE: ${{ github.ref}} - BRANCH_NAME: ${{ github.ref_name}} From 5ff5af397f22c31b58b6ebca1f4d9bb60ba6220b Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:04:48 +0100 Subject: [PATCH 05/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index 1118252..7d8af11 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -16,7 +16,17 @@ jobs: ref: dev - name: Create PR - run: gh pr create -B $BASE_BRANCH -H $BRANCH_TO_MERGE --title "$PR_TITLE" --body "$PR_BODY" + run: | + echo "Get the list of PR for that branch that are open" + gh pr list -H $BRANCH_TO_MERGE --json number -s "open" > pr_list.json + pr_count=$(jq length pr_list.json) + echo "Checking if there are any PR already" + if [[ pr_count -gt 0 ]]; then + echo "Indeed there is at least one PR for this branch" + else + echo "There is no PR for this branch so we create one" + gh pr create -B $BASE_BRANCH -H $BRANCH_TO_MERGE --title "$PR_TITLE" --body "$PR_BODY" + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_TITLE: "Autocreated PR: ${{ github.ref_name}}" From 1e136439856dd4988a4047d54021522b48a21c37 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:05:43 +0100 Subject: [PATCH 06/14] Update .random --- test-folder/.random | 1 + 1 file changed, 1 insertion(+) diff --git a/test-folder/.random b/test-folder/.random index 8b13789..d755074 100644 --- a/test-folder/.random +++ b/test-folder/.random @@ -1 +1,2 @@ +# lwneflenflkew From 37db34bc61e432841d3063044ed7b9db9381d82d Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:35:54 +0100 Subject: [PATCH 07/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index 7d8af11..83b5aa4 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -18,10 +18,10 @@ jobs: - name: Create PR run: | echo "Get the list of PR for that branch that are open" - gh pr list -H $BRANCH_TO_MERGE --json number -s "open" > pr_list.json - pr_count=$(jq length pr_list.json) + PR_COUNT = $(gh pr list -H $BRANCH_TO_MERGE -s "open") + echo $PR_COUNT echo "Checking if there are any PR already" - if [[ pr_count -gt 0 ]]; then + if [[ $PR_COUNT -gt 0 ]]; then echo "Indeed there is at least one PR for this branch" else echo "There is no PR for this branch so we create one" From f506826b4b432a9f4eacfaff4a95aef26b677130 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:48:55 +0100 Subject: [PATCH 08/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index 83b5aa4..73f9327 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -18,7 +18,7 @@ jobs: - name: Create PR run: | echo "Get the list of PR for that branch that are open" - PR_COUNT = $(gh pr list -H $BRANCH_TO_MERGE -s "open") + PR_COUNT=$(gh pr list -H $BRANCH_TO_MERGE -s "open") echo $PR_COUNT echo "Checking if there are any PR already" if [[ $PR_COUNT -gt 0 ]]; then From 3b6749131475a92e30fe2c07d8b4347fcde7ae21 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:52:29 +0100 Subject: [PATCH 09/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index 73f9327..c6007fb 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -18,7 +18,7 @@ jobs: - name: Create PR run: | echo "Get the list of PR for that branch that are open" - PR_COUNT=$(gh pr list -H $BRANCH_TO_MERGE -s "open") + PR_COUNT=$(gh pr list -H $BRANCH_TO_MERGE -s "open" | wc -l) echo $PR_COUNT echo "Checking if there are any PR already" if [[ $PR_COUNT -gt 0 ]]; then From 4b130b1476e0eb520ba879ee3780935347e57593 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:56:45 +0100 Subject: [PATCH 10/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index c6007fb..f65995e 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -18,6 +18,8 @@ jobs: - name: Create PR run: | echo "Get the list of PR for that branch that are open" + gh pr list -H $BRANCH_TO_MERGE -s "open" + gh pr list -H ${{ github.ref_name}} -s "open" PR_COUNT=$(gh pr list -H $BRANCH_TO_MERGE -s "open" | wc -l) echo $PR_COUNT echo "Checking if there are any PR already" From 1ea275d8c00e3a62aa83e2516beb8b75c54abc0f Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:01:20 +0100 Subject: [PATCH 11/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index f65995e..3c8d687 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -20,8 +20,13 @@ jobs: echo "Get the list of PR for that branch that are open" gh pr list -H $BRANCH_TO_MERGE -s "open" gh pr list -H ${{ github.ref_name}} -s "open" - PR_COUNT=$(gh pr list -H $BRANCH_TO_MERGE -s "open" | wc -l) - echo $PR_COUNT + PR_COUNT_A=$(gh pr list -H $BRANCH_TO_MERGE -s "open" | wc -l) + echo $PR_COUNT_A + PR_COUNT_B=$(gh pr list -H ${{ github.ref_name}} -s "open" | wc -l) + echo $PR_COUNT_B + PR_COUNT_C=$(gh pr list -H ${{ github.ref}} -s "open" | wc -l) + echo $PR_COUNT_C + echo "Checking if there are any PR already" if [[ $PR_COUNT -gt 0 ]]; then echo "Indeed there is at least one PR for this branch" From eacaca1ed6d59142d4347003982c798fbafca80a Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:05:40 +0100 Subject: [PATCH 12/14] Update pr-on-branch-push.yml --- .github/workflows/pr-on-branch-push.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-on-branch-push.yml b/.github/workflows/pr-on-branch-push.yml index 3c8d687..679fac0 100644 --- a/.github/workflows/pr-on-branch-push.yml +++ b/.github/workflows/pr-on-branch-push.yml @@ -18,15 +18,9 @@ jobs: - name: Create PR run: | echo "Get the list of PR for that branch that are open" - gh pr list -H $BRANCH_TO_MERGE -s "open" gh pr list -H ${{ github.ref_name}} -s "open" - PR_COUNT_A=$(gh pr list -H $BRANCH_TO_MERGE -s "open" | wc -l) - echo $PR_COUNT_A - PR_COUNT_B=$(gh pr list -H ${{ github.ref_name}} -s "open" | wc -l) - echo $PR_COUNT_B - PR_COUNT_C=$(gh pr list -H ${{ github.ref}} -s "open" | wc -l) - echo $PR_COUNT_C - + PR_COUNT=$(gh pr list -H ${{ github.ref_name}} -s "open" | wc -l) + echo $PR_COUNT echo "Checking if there are any PR already" if [[ $PR_COUNT -gt 0 ]]; then echo "Indeed there is at least one PR for this branch" From 07cd741d7eeaef81e000db1ddf6169da9b894485 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:19:30 +0100 Subject: [PATCH 13/14] Update label-new-issues.yml --- .github/workflows/label-new-issues.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/label-new-issues.yml b/.github/workflows/label-new-issues.yml index 286df11..32ae73b 100644 --- a/.github/workflows/label-new-issues.yml +++ b/.github/workflows/label-new-issues.yml @@ -44,16 +44,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - + - name: Create Branch id: create-branch run: | echo "We will create a branch with this name: $BRANCH_NAME" - git checkout -b $BRANCH_NAME - git push origin $BRANCH_NAME - echo "::set-output name=BRANCH_FULL_NAME::$BRANCH_NAME" - echo "::set-output name=BRANCH_SHA::$(git rev-parse HEAD)" + gh issue develop $ISSUE_NUMBER -b dev -n $BRANCH_NAME env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} BRANCH_NAME: ${{ steps.set-branch-name.outputs.BRANCH_FULL_NAME }} + ISSUE_NUMBER: ${{ github.event.issue.number }} From 972b680085fb6e96f2f7c70633a2ee0778618734 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Molina <142247121+ines-gimeno-molina@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:49:57 +0100 Subject: [PATCH 14/14] Create label-pr-as-issue.yml --- .github/workflows/label-pr-as-issue.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/label-pr-as-issue.yml diff --git a/.github/workflows/label-pr-as-issue.yml b/.github/workflows/label-pr-as-issue.yml new file mode 100644 index 0000000..c0cefd4 --- /dev/null +++ b/.github/workflows/label-pr-as-issue.yml @@ -0,0 +1,13 @@ +on: + pull_request: + types: [opened] + +jobs: + copy-labels: + runs-on: ubuntu-latest + name: Copy labels from linked issues + steps: + - name: copy-labels + uses: michalvankodev/copy-issue-labels@v1.3.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }}