From fa9a967981315d8bda6b3173281b103faebce025 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 21:40:09 -0300 Subject: [PATCH 01/30] analize pr context --- .github/workflows/auto-assign.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 7017759..4aef681 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -45,3 +45,6 @@ jobs: run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: show context + run: echo ${{github.event.pull_request}} From b8939a4be1df94d17ba436666977a3a117fa23c5 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 21:47:33 -0300 Subject: [PATCH 02/30] add base workflows --- .github/workflows/base-workflows.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/base-workflows.yml diff --git a/.github/workflows/base-workflows.yml b/.github/workflows/base-workflows.yml new file mode 100644 index 0000000..fa4d29e --- /dev/null +++ b/.github/workflows/base-workflows.yml @@ -0,0 +1,11 @@ +name: Base Actions + +on: + issue_comment: + types: [created] + pull_request: + +jobs: + assignes: + uses: devhatt/workflows/.github/workflows/auto-assign.yml@main + secrets: inherit From f6e937b2025b93328982de7cc5c6a83d79e661dc Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 21:50:05 -0300 Subject: [PATCH 03/30] ajust workflow trigger --- .github/workflows/auto-assign.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 4aef681..cf2b71f 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -2,6 +2,7 @@ name: Auto-assign workflows on: workflow_call: + workflow_dispatch: jobs: assign-on-issue: From c0611fe64f92d00954b77c59a11e422057973ada Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 21:52:42 -0300 Subject: [PATCH 04/30] ajust call workflow --- .github/workflows/base-workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base-workflows.yml b/.github/workflows/base-workflows.yml index fa4d29e..88c823b 100644 --- a/.github/workflows/base-workflows.yml +++ b/.github/workflows/base-workflows.yml @@ -7,5 +7,5 @@ on: jobs: assignes: - uses: devhatt/workflows/.github/workflows/auto-assign.yml@main + uses: devhatt/workflows/.github/workflows/auto-assign.yml@ajust-assign-author secrets: inherit From 1c36913c37ce793e1878c6e398270c69bf215897 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 21:55:04 -0300 Subject: [PATCH 05/30] ajust step --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index cf2b71f..48f5096 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -48,4 +48,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: show context - run: echo ${{github.event.pull_request}} + run: echo ${{toJSON(github.event.pull_request)}} From ca94e87fd8d8caa8cbeafc28cb70cfe5ddec7bc5 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:01:11 -0300 Subject: [PATCH 06/30] ajust wolkflow condition --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 48f5096..8bb499b 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -37,7 +37,7 @@ jobs: assing-contributor-on-pr: runs-on: ubuntu-latest - if: ${{github.event_name == 'pull_request'}} + if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees == []}} steps: - name: Checkout uses: actions/checkout@v4.1.7 From db1853fcbe35ddcd7cf81378db7622e5f2e2f328 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:03:00 -0300 Subject: [PATCH 07/30] remove context --- .github/workflows/auto-assign.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 8bb499b..8c91c39 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -46,6 +46,3 @@ jobs: run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: show context - run: echo ${{toJSON(github.event.pull_request)}} From f969df5f7df5067f78bea94b50ff49d7d21a6fc4 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:11:12 -0300 Subject: [PATCH 08/30] ajust workflow --- .github/workflows/auto-assign.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 8c91c39..95afbd7 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -37,7 +37,7 @@ jobs: assing-contributor-on-pr: runs-on: ubuntu-latest - if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees == []}} + if: ${{github.event_name == 'pull_request' && == []}} steps: - name: Checkout uses: actions/checkout@v4.1.7 @@ -46,3 +46,6 @@ jobs: run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Show Assigness + run: echo ${{toJSON('github.event.pull_request.assignees')}} From f271f3f354c3b207f8ac6b057673d341edb5d6d5 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:11:38 -0300 Subject: [PATCH 09/30] ajust --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 95afbd7..04a336b 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -37,7 +37,7 @@ jobs: assing-contributor-on-pr: runs-on: ubuntu-latest - if: ${{github.event_name == 'pull_request' && == []}} + if: ${{github.event_name == 'pull_request'}} steps: - name: Checkout uses: actions/checkout@v4.1.7 From 671eec409f32f5e22ab31b38123c3b7316fa1c2a Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:12:52 -0300 Subject: [PATCH 10/30] ajust 2 --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 04a336b..2f1f31b 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -48,4 +48,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Show Assigness - run: echo ${{toJSON('github.event.pull_request.assignees')}} + run: echo ${{toJSON(github.event.pull_request.assignees)}} From 3aff9358bd9724baa5b1d312b1b573b1c7dbd22d Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:14:32 -0300 Subject: [PATCH 11/30] ajust position flux --- .github/workflows/auto-assign.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 2f1f31b..ff33da8 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -41,11 +41,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.7 - + - name: Show Assigness + run: echo ${{toJSON(github.event.pull_request.assignees)}} - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Show Assigness - run: echo ${{toJSON(github.event.pull_request.assignees)}} From a094a4add09cf93348399175f77429554710ded4 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:17:36 -0300 Subject: [PATCH 12/30] show condition --- .github/workflows/auto-assign.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index ff33da8..ad1a81d 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -41,8 +41,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.7 + - name: Show Assigness - run: echo ${{toJSON(github.event.pull_request.assignees)}} + run: echo ${{contains(github.event.pull_request.assignees, '')}} + - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} env: From 38f9d342bda02a09c1b705313eed6fb8f2465b91 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:18:45 -0300 Subject: [PATCH 13/30] change contains --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index ad1a81d..d4f14ce 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -43,7 +43,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Show Assigness - run: echo ${{contains(github.event.pull_request.assignees, '')}} + run: echo ${{contains(github.event.pull_request.assignees, [])}} - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} From 752d737b0095688cabad18b41914819208c89c30 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:21:06 -0300 Subject: [PATCH 14/30] ajust contains 2 --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index d4f14ce..7bba96f 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -43,7 +43,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Show Assigness - run: echo ${{contains(github.event.pull_request.assignees, [])}} + run: echo ${{contains(github.event.pull_request.assignees, '[]')}} - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} From f8046c4f305a6cb24cbab5d10b9d3e58db054389 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:23:52 -0300 Subject: [PATCH 15/30] ajust condition --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 7bba96f..80889d3 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -43,7 +43,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Show Assigness - run: echo ${{contains(github.event.pull_request.assignees, '[]')}} + run: echo ${{github.event.pull_request.assignees == null}} - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} From 013c3f82e778f8a9e453de7c26aa40087065e217 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:25:27 -0300 Subject: [PATCH 16/30] test flux control --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 80889d3..dc97bba 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -43,7 +43,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Show Assigness - run: echo ${{github.event.pull_request.assignees == null}} + run: echo ${{github.event.pull_request.assignees == [] }} - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} From 6814fa9468e47b2ec41e266afb99b05dd53a3b28 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:27:55 -0300 Subject: [PATCH 17/30] Ajust trigger --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index dc97bba..2db6f86 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -43,7 +43,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Show Assigness - run: echo ${{github.event.pull_request.assignees == [] }} + run: echo ${{github.event.pull_request.assignees | length == 0 }} - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} From 465dede5196ce65240cdc1a100ece8416cccc927 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:30:06 -0300 Subject: [PATCH 18/30] ajust trigger --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 2db6f86..4f6939a 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -43,7 +43,7 @@ jobs: uses: actions/checkout@v4.1.7 - name: Show Assigness - run: echo ${{github.event.pull_request.assignees | length == 0 }} + run: echo ${{github.event.pull_request.assignees.length == 0 }} - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} From 22bf4324ea460828d606160d8ee457f1e977f533 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:31:41 -0300 Subject: [PATCH 19/30] ajust workflow call --- .github/workflows/auto-assign.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 4f6939a..574aac4 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -37,14 +37,11 @@ jobs: assing-contributor-on-pr: runs-on: ubuntu-latest - if: ${{github.event_name == 'pull_request'}} + if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} steps: - name: Checkout uses: actions/checkout@v4.1.7 - - name: Show Assigness - run: echo ${{github.event.pull_request.assignees.length == 0 }} - - name: Assigna o criador do pr no proprio pr run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} env: From ef676a622cf982f8e65632d8bb8c6c08fe3edaf4 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:34:58 -0300 Subject: [PATCH 20/30] test workflow --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 574aac4..34434c4 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -37,7 +37,7 @@ jobs: assing-contributor-on-pr: runs-on: ubuntu-latest - if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} + if: ${{github.event_name == 'pull_request' || github.event.pull_request.assignees.length == 0}} steps: - name: Checkout uses: actions/checkout@v4.1.7 From 9b7ec6621267d93764616ca02b0189ca1a748c32 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:41:39 -0300 Subject: [PATCH 21/30] ajust conditional --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 34434c4..574aac4 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -37,7 +37,7 @@ jobs: assing-contributor-on-pr: runs-on: ubuntu-latest - if: ${{github.event_name == 'pull_request' || github.event.pull_request.assignees.length == 0}} + if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} steps: - name: Checkout uses: actions/checkout@v4.1.7 From e6128c23b321a285b8d5847a59163f86bb80032a Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:44:07 -0300 Subject: [PATCH 22/30] Ajust commit --- .github/workflows/auto-assign.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 574aac4..1958b30 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -39,6 +39,9 @@ jobs: runs-on: ubuntu-latest if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} steps: + - name: test conditio + uses: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} + - name: Checkout uses: actions/checkout@v4.1.7 From ab2efc8f31090f4b84505c1b6283f94975f77608 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:46:50 -0300 Subject: [PATCH 23/30] ajust step --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 1958b30..2ff84b3 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -40,7 +40,7 @@ jobs: if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} steps: - name: test conditio - uses: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} + run: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} - name: Checkout uses: actions/checkout@v4.1.7 From 9577517c2bb79edb9bc3468b8b125609a23a264d Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 22:48:37 -0300 Subject: [PATCH 24/30] ajust ruun flow --- .github/workflows/auto-assign.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 2ff84b3..0cb1682 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -40,7 +40,9 @@ jobs: if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} steps: - name: test conditio - run: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} + run: | + echo ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} + ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} - name: Checkout uses: actions/checkout@v4.1.7 From 34a7a55133052e75167e61b6b55a7ac64f83e2c0 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 23:36:55 -0300 Subject: [PATCH 25/30] alalyze logic --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 0cb1682..4cd7b90 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -41,7 +41,7 @@ jobs: steps: - name: test conditio run: | - echo ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} + echo ${{github.event_name == 'pull_request' || github.event.pull_request.assignees.length == 0}} ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} - name: Checkout From 0b9b4ed20e5f9da5c2bc7a0974def72fdc9d3ebe Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 23:41:21 -0300 Subject: [PATCH 26/30] ajus logic --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 4cd7b90..f78cccf 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -41,7 +41,7 @@ jobs: steps: - name: test conditio run: | - echo ${{github.event_name == 'pull_request' || github.event.pull_request.assignees.length == 0}} + echo ${{github.event.pull_request.assignees.length == 0}} ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} - name: Checkout From 4c733398c848cf68db99eb3772db48336a9c778c Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 23:46:55 -0300 Subject: [PATCH 27/30] ajus workflow --- .github/workflows/auto-assign.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index f78cccf..0f60bb7 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -37,17 +37,22 @@ jobs: assing-contributor-on-pr: runs-on: ubuntu-latest - if: ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} + if: ${{github.event_name == 'pull_request'}} + steps: - - name: test conditio + - name: Check assignees + id: check run: | - echo ${{github.event.pull_request.assignees.length == 0}} - ${{github.event_name == 'pull_request' && github.event.pull_request.assignees.length == 0}} + ASSIGNEES=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/assignees" | jq length) + echo "::set-output name=assignees::$ASSIGNEES" + shell: bash - name: Checkout uses: actions/checkout@v4.1.7 - name: Assigna o criador do pr no proprio pr + if: ${{ steps.check.outputs.assignees == '0' }} run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.actor }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From cecc58f3713bf201fee6d87c0dbb6793ccf3213c Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 23:47:47 -0300 Subject: [PATCH 28/30] ajust workflow --- .github/workflows/auto-assign.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 0f60bb7..a8542f4 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -43,7 +43,7 @@ jobs: - name: Check assignees id: check run: | - ASSIGNEES=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + ASSIGNEES=$(curl -H "Authorization: token ${{secrets.PERSONAL_ACCESS_TOKEN}}" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/assignees" | jq length) echo "::set-output name=assignees::$ASSIGNEES" shell: bash From ea2053fe426f4b36b8a9fc0c0d3964c96fe01702 Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 23:49:54 -0300 Subject: [PATCH 29/30] ajust trigger --- .github/workflows/auto-assign.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index a8542f4..4eb99c3 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -49,6 +49,7 @@ jobs: shell: bash - name: Checkout + if: ${{ steps.check.outputs.assignees == '0' }} uses: actions/checkout@v4.1.7 - name: Assigna o criador do pr no proprio pr From fde83760cd9cf1faa42f3c801d79fadda9393a5e Mon Sep 17 00:00:00 2001 From: Paulo V T Silva Date: Mon, 19 Aug 2024 23:53:20 -0300 Subject: [PATCH 30/30] ajust and finish workflow --- .github/workflows/auto-assign.yml | 2 +- .github/workflows/base-workflows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 4eb99c3..0370358 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -40,7 +40,7 @@ jobs: if: ${{github.event_name == 'pull_request'}} steps: - - name: Check assignees + - name: Check if pr has assignee id: check run: | ASSIGNEES=$(curl -H "Authorization: token ${{secrets.PERSONAL_ACCESS_TOKEN}}" \ diff --git a/.github/workflows/base-workflows.yml b/.github/workflows/base-workflows.yml index 88c823b..fa4d29e 100644 --- a/.github/workflows/base-workflows.yml +++ b/.github/workflows/base-workflows.yml @@ -7,5 +7,5 @@ on: jobs: assignes: - uses: devhatt/workflows/.github/workflows/auto-assign.yml@ajust-assign-author + uses: devhatt/workflows/.github/workflows/auto-assign.yml@main secrets: inherit