From ca947fad39960e2263b003165c246a8d0dcbfe2d Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Tue, 13 Sep 2022 08:58:13 +0200 Subject: [PATCH 01/14] Labeling step Added step to the pipeline so it will use the new action to add the pipeline end status to the pr as a label. --- .github/workflows/test-deploy-fork.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy-fork.yml b/.github/workflows/test-deploy-fork.yml index 5031e003cd..1fc29f21aa 100644 --- a/.github/workflows/test-deploy-fork.yml +++ b/.github/workflows/test-deploy-fork.yml @@ -265,7 +265,7 @@ jobs: env: PR_NUMBER: ${{ needs.prepare_jobs.outputs.pr_number }} steps: - - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - name: Comment uses: ./.github/actions/fork-result-comment @@ -275,6 +275,13 @@ jobs: ❌ CI run has failed! Please see logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + - name: Label + uses: ./.github/actions/fork-result-label + continue-on-error: true + with: + SUCCESS: 'false' + PULL_REQUEST_NUMBER: ${{ env.PR_NUMBER }} + notify_success: runs-on: ubuntu-latest if: success() @@ -287,7 +294,7 @@ jobs: env: PR_NUMBER: ${{ needs.prepare_jobs.outputs.pr_number }} steps: - - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - name: Comment uses: ./.github/actions/fork-result-comment @@ -296,3 +303,10 @@ jobs: COMMENT_BODY: | ✅ CI run has succeded! You can find tests and deployment logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + + - name: Label + uses: ./.github/actions/fork-result-label + continue-on-error: true + with: + SUCCESS: 'true' + PULL_REQUEST_NUMBER: ${{ env.PR_NUMBER }} From 83f66ba3f7988ebe9a02e787ead50179eb949a28 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Tue, 13 Sep 2022 09:00:50 +0200 Subject: [PATCH 02/14] Added labeling action Added action to add label to the fork pr with the pipeline result. --- .github/actions/fork-result-label/action.yml | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/actions/fork-result-label/action.yml diff --git a/.github/actions/fork-result-label/action.yml b/.github/actions/fork-result-label/action.yml new file mode 100644 index 0000000000..3ccfae51af --- /dev/null +++ b/.github/actions/fork-result-label/action.yml @@ -0,0 +1,35 @@ +name: Add label to PR with CI results +description: Add label to PR with CI results +inputs: + SUCCESS: + description: Text of the comment + required: true + PULL_REQUEST_NUMBER: + description: Pull request id + required: false + default: "0" +runs: + using: "composite" + steps: + - name: delete success label + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: "CI run has succeded!" + number: ${{ inputs.PULL_REQUEST_NUMBER }} + - name: delete fail label + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: "CI run has failed!" + number: ${{ inputs.PULL_REQUEST_NUMBER }} + - name: adding success label + uses: actions-ecosystem/action-add-labels@v1 + if: ${{ inputs.SUCCESS == 'true' }} + with: + labels: "CI run has succeded!" + number: ${{ inputs.PULL_REQUEST_NUMBER }} + - name: adding fail label + uses: actions-ecosystem/action-add-labels@v1 + if: ${{ inputs.SUCCESS == 'false' }} + with: + labels: "CI run has failed!" + number: ${{ inputs.PULL_REQUEST_NUMBER }} From 684cb7653d682bd5f7066525f792adc882ea12c0 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Tue, 13 Sep 2022 09:08:48 +0200 Subject: [PATCH 03/14] checkout version setting checkout version as it was --- .github/workflows/test-deploy-fork.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-deploy-fork.yml b/.github/workflows/test-deploy-fork.yml index 1fc29f21aa..2e93c58ad2 100644 --- a/.github/workflows/test-deploy-fork.yml +++ b/.github/workflows/test-deploy-fork.yml @@ -265,7 +265,7 @@ jobs: env: PR_NUMBER: ${{ needs.prepare_jobs.outputs.pr_number }} steps: - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 + - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 - name: Comment uses: ./.github/actions/fork-result-comment @@ -294,7 +294,7 @@ jobs: env: PR_NUMBER: ${{ needs.prepare_jobs.outputs.pr_number }} steps: - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 + - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 - name: Comment uses: ./.github/actions/fork-result-comment From abab2a45b6853440e8fefd257ae9da95a2016085 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Tue, 13 Sep 2022 14:31:46 +0200 Subject: [PATCH 04/14] Change label content Changed labels content added --- .github/actions/fork-result-label/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/fork-result-label/action.yml b/.github/actions/fork-result-label/action.yml index 3ccfae51af..d74427b2c5 100644 --- a/.github/actions/fork-result-label/action.yml +++ b/.github/actions/fork-result-label/action.yml @@ -14,22 +14,22 @@ runs: - name: delete success label uses: actions-ecosystem/action-remove-labels@v1 with: - labels: "CI run has succeded!" + labels: "CI Passed" number: ${{ inputs.PULL_REQUEST_NUMBER }} - name: delete fail label uses: actions-ecosystem/action-remove-labels@v1 with: - labels: "CI run has failed!" + labels: "CI Failed" number: ${{ inputs.PULL_REQUEST_NUMBER }} - name: adding success label uses: actions-ecosystem/action-add-labels@v1 if: ${{ inputs.SUCCESS == 'true' }} with: - labels: "CI run has succeded!" + labels: "CI Passed" number: ${{ inputs.PULL_REQUEST_NUMBER }} - name: adding fail label uses: actions-ecosystem/action-add-labels@v1 if: ${{ inputs.SUCCESS == 'false' }} with: - labels: "CI run has failed!" + labels: "CI Failed" number: ${{ inputs.PULL_REQUEST_NUMBER }} From 95deb82f54b74711b35b485a19e36ecd9ac9ca32 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Tue, 13 Sep 2022 14:44:53 +0200 Subject: [PATCH 05/14] Change actions version Changed actions to add label from v1 to commit_sha to make it immutable --- .github/actions/fork-result-label/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/fork-result-label/action.yml b/.github/actions/fork-result-label/action.yml index d74427b2c5..38dd88ca9b 100644 --- a/.github/actions/fork-result-label/action.yml +++ b/.github/actions/fork-result-label/action.yml @@ -12,23 +12,23 @@ runs: using: "composite" steps: - name: delete success label - uses: actions-ecosystem/action-remove-labels@v1 + uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 with: labels: "CI Passed" number: ${{ inputs.PULL_REQUEST_NUMBER }} - name: delete fail label - uses: actions-ecosystem/action-remove-labels@v1 + uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 with: labels: "CI Failed" number: ${{ inputs.PULL_REQUEST_NUMBER }} - name: adding success label - uses: actions-ecosystem/action-add-labels@v1 + uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8 if: ${{ inputs.SUCCESS == 'true' }} with: labels: "CI Passed" number: ${{ inputs.PULL_REQUEST_NUMBER }} - name: adding fail label - uses: actions-ecosystem/action-add-labels@v1 + uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8 if: ${{ inputs.SUCCESS == 'false' }} with: labels: "CI Failed" From 12e87a4bed6ed41effe29780fc14f042359ea10f Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 17:24:18 +0200 Subject: [PATCH 06/14] add label to pr Made a workflow to add a label to a pr --- .github/workflows/add-label.yml | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/add-label.yml diff --git a/.github/workflows/add-label.yml b/.github/workflows/add-label.yml new file mode 100644 index 0000000000..e1c7deef88 --- /dev/null +++ b/.github/workflows/add-label.yml @@ -0,0 +1,57 @@ +name: Test adding label to pr + +concurrency: + group: ${{ github.workflow }}-${{ github.event.workflow_run.id }} + cancel-in-progress: true + +on: + workflow_run: + workflows: ["Build PR From Fork"] + types: ["completed"] + branches-ignore: ["main"] + +jobs: + prepare_jobs: + runs-on: ubuntu-latest + outputs: + pr_number: '${{ steps.get_pr_number.outputs.pr_number }}' + steps: + - name: Download PR info + uses: dawidd6/action-download-artifact@575b1e4167df67acf7e692af784566618b23c71e # v2.17.0 + with: + workflow: "" + run_id: "${{ github.event.workflow_run.id }}" + workflow_conclusion: success + name: pr + path: ./ + + - name: Get PR number + shell: sh + id: get_pr_number + run: | + echo "::set-output name=pr_number::$(cat NUM | tr -dc '[:digit:]')" + notify_failure: + runs-on: ubuntu-latest + env: + PR_NUMBER: ${{ needs.prepare_jobs.outputs.pr_number }} + steps: + - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 + - name: Label + uses: ./.github/actions/fork-result-label + continue-on-error: true + with: + SUCCESS: 'false' + PULL_REQUEST_NUMBER: ${{ env.PR_NUMBER }} + + notify_success: + runs-on: ubuntu-latest + env: + PR_NUMBER: ${{ needs.prepare_jobs.outputs.pr_number }} + steps: + - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 + - name: Label + uses: ./.github/actions/fork-result-label + continue-on-error: true + with: + SUCCESS: 'true' + PULL_REQUEST_NUMBER: ${{ env.PR_NUMBER }} From 88247c32b1c8ba5b6c6a25d60e36b27237dadb9a Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 17:30:45 +0200 Subject: [PATCH 07/14] test update update --- .github/workflows/add-label.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/add-label.yml b/.github/workflows/add-label.yml index e1c7deef88..da8b95d8f3 100644 --- a/.github/workflows/add-label.yml +++ b/.github/workflows/add-label.yml @@ -16,15 +16,6 @@ jobs: outputs: pr_number: '${{ steps.get_pr_number.outputs.pr_number }}' steps: - - name: Download PR info - uses: dawidd6/action-download-artifact@575b1e4167df67acf7e692af784566618b23c71e # v2.17.0 - with: - workflow: "" - run_id: "${{ github.event.workflow_run.id }}" - workflow_conclusion: success - name: pr - path: ./ - - name: Get PR number shell: sh id: get_pr_number From c27601bff92d700510e233ef124eb441ebcd6cdf Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 17:33:05 +0200 Subject: [PATCH 08/14] test label test label --- .babelrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.babelrc b/.babelrc index 18f6256403..de7752a17a 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,5 @@ { "presets": ["next/babel"], + "plugins": ["macros", "@babel/plugin-proposal-class-properties"] } From 166be82d2c44f3051a045a81070e1a7afb122eef Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 17:40:54 +0200 Subject: [PATCH 09/14] get pr number test testing --- .github/workflows/add-label.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/add-label.yml b/.github/workflows/add-label.yml index da8b95d8f3..21063b637c 100644 --- a/.github/workflows/add-label.yml +++ b/.github/workflows/add-label.yml @@ -23,10 +23,15 @@ jobs: echo "::set-output name=pr_number::$(cat NUM | tr -dc '[:digit:]')" notify_failure: runs-on: ubuntu-latest + needs: ["prepare_jobs"] env: PR_NUMBER: ${{ needs.prepare_jobs.outputs.pr_number }} steps: - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 + - name: Get PR number + shell: sh + run: | + echo "${{ env.PR_NUMBER }}" - name: Label uses: ./.github/actions/fork-result-label continue-on-error: true @@ -36,10 +41,15 @@ jobs: notify_success: runs-on: ubuntu-latest + needs: ["prepare_jobs"] env: PR_NUMBER: ${{ needs.prepare_jobs.outputs.pr_number }} steps: - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 + - name: Get PR number + shell: sh + run: | + echo "${{ env.PR_NUMBER }}" - name: Label uses: ./.github/actions/fork-result-label continue-on-error: true From 67215f43f7d6a67aa6666c6689797ba4d308dd88 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 17:57:42 +0200 Subject: [PATCH 10/14] test2 --- .babelrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.babelrc b/.babelrc index de7752a17a..18f6256403 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,4 @@ { "presets": ["next/babel"], - "plugins": ["macros", "@babel/plugin-proposal-class-properties"] } From 674643dfe69f23e2ca71e19533ed5c51f24ee365 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:06:57 +0200 Subject: [PATCH 11/14] set --- .github/workflows/add-label.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/add-label.yml b/.github/workflows/add-label.yml index 21063b637c..a27f9c549d 100644 --- a/.github/workflows/add-label.yml +++ b/.github/workflows/add-label.yml @@ -16,6 +16,15 @@ jobs: outputs: pr_number: '${{ steps.get_pr_number.outputs.pr_number }}' steps: + - name: Download PR info + uses: dawidd6/action-download-artifact@ea71f332a90fd52416b1629b933dcf7e0ccd421d # v2.22.0 + with: + workflow: build-fork.yml + run_id: "${{ github.event.workflow_run.id }}" + workflow_conclusion: "" + name: pr + path: ./ + - name: Get PR number shell: sh id: get_pr_number From 91129f51831fcf5e09d7c231bdf5c55d763c6066 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:17:50 +0200 Subject: [PATCH 12/14] Update add-label.yml --- .github/workflows/add-label.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/add-label.yml b/.github/workflows/add-label.yml index a27f9c549d..01aeb5b5af 100644 --- a/.github/workflows/add-label.yml +++ b/.github/workflows/add-label.yml @@ -16,20 +16,19 @@ jobs: outputs: pr_number: '${{ steps.get_pr_number.outputs.pr_number }}' steps: - - name: Download PR info - uses: dawidd6/action-download-artifact@ea71f332a90fd52416b1629b933dcf7e0ccd421d # v2.22.0 - with: - workflow: build-fork.yml - run_id: "${{ github.event.workflow_run.id }}" - workflow_conclusion: "" - name: pr - path: ./ + - uses: 8BitJonny/gh-get-current-pr@2.1.1 + id: PR + - run: echo "Your PR number is ${{ steps.PR.outputs.number }} and its JSON is ${{ steps.PR.outputs.pr }}" + + - name: Get PR number + shell: sh + run: echo "${{ steps.PR.outputs.number }}" - name: Get PR number shell: sh id: get_pr_number run: | - echo "::set-output name=pr_number::$(cat NUM | tr -dc '[:digit:]')" + echo "::set-output name=pr_number::${{ steps.PR.outputs.number }}" notify_failure: runs-on: ubuntu-latest needs: ["prepare_jobs"] From a79870717aebc6a17bcc650d8cfff688268c5607 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:21:43 +0200 Subject: [PATCH 13/14] Update .env.development --- .env.development | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.development b/.env.development index b2ce4ad539..6684961ee2 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,3 @@ NEXT_PUBLIC_ENV=prod NEXT_PUBLIC_SCREENING_URL=https://aave-api-v2.aave.com + From f77d2ffcd1c8182ec2d83788cb2dbc499d44d972 Mon Sep 17 00:00:00 2001 From: marcPineiroAave <107112627+marcPineiroAave@users.noreply.github.com> Date: Wed, 14 Sep 2022 18:22:02 +0200 Subject: [PATCH 14/14] Update .env.development --- .env.development | 1 - 1 file changed, 1 deletion(-) diff --git a/.env.development b/.env.development index 6684961ee2..b2ce4ad539 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,2 @@ NEXT_PUBLIC_ENV=prod NEXT_PUBLIC_SCREENING_URL=https://aave-api-v2.aave.com -