From b52d8a0f1e563bb3dfa3598f6bb380934886823e Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 15:35:04 +0200 Subject: [PATCH 01/27] Add container messages --- .github/workflows/test-containers.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index a8b50ace..d2448076 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -1,6 +1,6 @@ name: Test containers -on: [push] +on: [push, pull_request] jobs: container-images: @@ -31,3 +31,13 @@ jobs: snapshot: false tags: "${{ steps.extract_branch.outputs.branch }}" buildoptions: "--pull" + + comments: + if: ${{ github.event_name == 'pull_request' }} + runs-on: ubuntu-latest + steps: + - name: Comment PR + uses: allthatjazzleo/actions-pull-request-add-comment@master + with: + message: "echo ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui dynamic message" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 35a372690db57ec0aaa1362bc5753c45c4abad02 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 15:40:45 +0200 Subject: [PATCH 02/27] change message --- .github/workflows/test-containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index d2448076..6a2d14f4 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -39,5 +39,5 @@ jobs: - name: Comment PR uses: allthatjazzleo/actions-pull-request-add-comment@master with: - message: "echo ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui dynamic message" + message: "Example of message !" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 781b629e11fa336302973d40e341a241e0b08ce6 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 15:44:02 +0200 Subject: [PATCH 03/27] message --- .github/workflows/test-containers.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index 6a2d14f4..9b7c7142 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -36,8 +36,12 @@ jobs: if: ${{ github.event_name == 'pull_request' }} runs-on: ubuntu-latest steps: - - name: Comment PR - uses: allthatjazzleo/actions-pull-request-add-comment@master + - uses: actions/github-script@v4 with: - message: "Example of message !" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thanks for reporting!' + }) From 3b46812d07fc8df04604ce71364e89026c42bab4 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 15:57:41 +0200 Subject: [PATCH 04/27] add pull_request_target --- .github/workflows/test-containers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index 9b7c7142..9658d628 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -1,6 +1,6 @@ name: Test containers -on: [push, pull_request] +on: [push, pull_request_target] jobs: container-images: @@ -33,7 +33,7 @@ jobs: buildoptions: "--pull" comments: - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request_target' }} runs-on: ubuntu-latest steps: - uses: actions/github-script@v4 From a453e927edcc7fdd7f7295eba985cb1f053f4415 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:09:33 +0200 Subject: [PATCH 05/27] Secrets --- .github/workflows/test-containers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index 9658d628..590397e2 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -45,3 +45,4 @@ jobs: repo: context.repo.repo, body: '👋 Thanks for reporting!' }) + repo-token: ${{ secrets.GITHUB_TOKEN }} From 9326d1899aacb1b8eaa5bda4f01559f725fc6b69 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:15:13 +0200 Subject: [PATCH 06/27] pull_request --- .github/workflows/test-containers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index 590397e2..75d79f2c 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -1,6 +1,6 @@ name: Test containers -on: [push, pull_request_target] +on: [push, pull_request] jobs: container-images: @@ -33,7 +33,7 @@ jobs: buildoptions: "--pull" comments: - if: ${{ github.event_name == 'pull_request_target' }} + if: ${{ github.event_name == 'pull_request' }} runs-on: ubuntu-latest steps: - uses: actions/github-script@v4 From fea702429dc0ef97bca1323309ad7f79fc17f524 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:16:21 +0200 Subject: [PATCH 07/27] github-token --- .github/workflows/test-containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index 75d79f2c..2c23d7c0 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -45,4 +45,4 @@ jobs: repo: context.repo.repo, body: '👋 Thanks for reporting!' }) - repo-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} From 7fff2f6bee054c2276f88206de137bd92ba88346 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:24:49 +0200 Subject: [PATCH 08/27] Comment --- .github/workflows/test-containers.yml | 59 +++++++++++++-------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index 2c23d7c0..f63c8881 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -1,39 +1,38 @@ name: Test containers -on: [push, pull_request] +on: [pull_request_target] jobs: - container-images: - if: ${{ github.event_name != 'pull_request' && github.repository_owner != 'konveyor' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Build - run: | - yarn install - yarn build - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: Push to GitHub Packages - uses: elgohr/Publish-Docker-Github-Action@3.02 - with: - registry: docker.pkg.github.com - name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - dockerfile: Dockerfile - snapshot: false - tags: "${{ steps.extract_branch.outputs.branch }}" - buildoptions: "--pull" + # container-images: + # if: ${{ github.event_name != 'pull_request' && github.repository_owner != 'konveyor' }} + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - name: Use Node.js + # uses: actions/setup-node@v1 + # with: + # node-version: 12.x + # - name: Build + # run: | + # yarn install + # yarn build + # - name: Extract branch name + # shell: bash + # run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + # id: extract_branch + # - name: Push to GitHub Packages + # uses: elgohr/Publish-Docker-Github-Action@3.02 + # with: + # registry: docker.pkg.github.com + # name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + # dockerfile: Dockerfile + # snapshot: false + # tags: "${{ steps.extract_branch.outputs.branch }}" + # buildoptions: "--pull" comments: - if: ${{ github.event_name == 'pull_request' }} runs-on: ubuntu-latest steps: - uses: actions/github-script@v4 From d056eac1ad7fd30e2997222e0375c7b01ce8071c Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:59:54 +0200 Subject: [PATCH 09/27] 2 steps --- .github/workflows/test-containers-comment.yml | 47 +++++++++++++++++++ .github/workflows/test-containers.yml | 44 ++++++----------- 2 files changed, 61 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/test-containers-comment.yml diff --git a/.github/workflows/test-containers-comment.yml b/.github/workflows/test-containers-comment.yml new file mode 100644 index 00000000..b38f7fc3 --- /dev/null +++ b/.github/workflows/test-containers-comment.yml @@ -0,0 +1,47 @@ +name: Comments + +on: + workflow_run: + workflows: ["Build PR"] + types: + - completed + +jobs: + upload: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} + steps: + - name: "Download artifact" + uses: actions/github-script@v3.1.0 + with: + script: | + var artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, + }); + var matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == "pr" + })[0]; + var download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + var fs = require('fs'); + fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); + - run: unzip pr.zip + - uses: actions/github-script@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + var fs = require('fs'); + var issue_number = Number(fs.readFileSync('./NR')); + + github.issues.createComment({ + issue_number: issue_number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thanks for reporting!' + }) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index f63c8881..fc9f6272 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -1,36 +1,20 @@ -name: Test containers +name: Build PR -on: [pull_request_target] +on: [pull_request] jobs: - # container-images: - # if: ${{ github.event_name != 'pull_request' && github.repository_owner != 'konveyor' }} - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Use Node.js - # uses: actions/setup-node@v1 - # with: - # node-version: 12.x - # - name: Build - # run: | - # yarn install - # yarn build - # - name: Extract branch name - # shell: bash - # run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - # id: extract_branch - # - name: Push to GitHub Packages - # uses: elgohr/Publish-Docker-Github-Action@3.02 - # with: - # registry: docker.pkg.github.com - # name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} - # dockerfile: Dockerfile - # snapshot: false - # tags: "${{ steps.extract_branch.outputs.branch }}" - # buildoptions: "--pull" + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Save PR number + run: | + mkdir -p ./pr + echo ${{ github.event.number }} > ./pr/NR + - uses: actions/upload-artifact@v2 + with: + name: pr + path: pr/ comments: runs-on: ubuntu-latest From b7440e797a31ee7a06626f222c31e32d9741864c Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:04:29 +0200 Subject: [PATCH 10/27] paste --- .github/workflows/test-containers-comment.yml | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-containers-comment.yml b/.github/workflows/test-containers-comment.yml index b38f7fc3..8c57eee9 100644 --- a/.github/workflows/test-containers-comment.yml +++ b/.github/workflows/test-containers-comment.yml @@ -16,32 +16,33 @@ jobs: with: script: | var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, }); var matchArtifact = artifacts.data.artifacts.filter((artifact) => { return artifact.name == "pr" })[0]; var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', }); var fs = require('fs'); fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - run: unzip pr.zip - - uses: actions/github-script@v4 + + - name: "Comment on PR" + uses: actions/github-script@v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | var fs = require('fs'); var issue_number = Number(fs.readFileSync('./NR')); - - github.issues.createComment({ - issue_number: issue_number, + await github.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, - body: '👋 Thanks for reporting!' - }) + issue_number: issue_number, + body: 'Everything is OK. Thank you for the PR!' + }); From 0cb7514d429e904d61aa6716450de9a7e5d5fff6 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:28:20 +0200 Subject: [PATCH 11/27] message --- .github/workflows/test-containers-comment.yml | 48 ------------------- .github/workflows/test-containers.yml | 34 ++++--------- 2 files changed, 9 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/test-containers-comment.yml diff --git a/.github/workflows/test-containers-comment.yml b/.github/workflows/test-containers-comment.yml deleted file mode 100644 index 8c57eee9..00000000 --- a/.github/workflows/test-containers-comment.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Comments - -on: - workflow_run: - workflows: ["Build PR"] - types: - - completed - -jobs: - upload: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} - steps: - - name: "Download artifact" - uses: actions/github-script@v3.1.0 - with: - script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "pr" - })[0]; - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); - - run: unzip pr.zip - - - name: "Comment on PR" - uses: actions/github-script@v3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - var fs = require('fs'); - var issue_number = Number(fs.readFileSync('./NR')); - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue_number, - body: 'Everything is OK. Thank you for the PR!' - }); diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index fc9f6272..b35241a3 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -1,31 +1,15 @@ -name: Build PR +name: Welcome comment -on: [pull_request] +on: + pull_request_target: + types: [opened, labeled] jobs: - build: + Welcome: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Save PR number - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - - uses: actions/upload-artifact@v2 + - uses: actions/first-interaction@v1.0.0 with: - name: pr - path: pr/ - - comments: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v4 - with: - script: | - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '👋 Thanks for reporting!' - }) - github-token: ${{ secrets.GITHUB_TOKEN }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + pr-message: |- + congrats From c811136d1ed0c978b4ed4195d0ab83f5c49950a4 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:30:52 +0200 Subject: [PATCH 12/27] Test containers --- .github/workflows/test-containers.yml | 36 +++++++-------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index a8b50ace..b35241a3 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -1,33 +1,15 @@ -name: Test containers +name: Welcome comment -on: [push] +on: + pull_request_target: + types: [opened, labeled] jobs: - container-images: - if: ${{ github.event_name != 'pull_request' && github.repository_owner != 'konveyor' }} + Welcome: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 + - uses: actions/first-interaction@v1.0.0 with: - node-version: 12.x - - name: Build - run: | - yarn install - yarn build - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: Push to GitHub Packages - uses: elgohr/Publish-Docker-Github-Action@3.02 - with: - registry: docker.pkg.github.com - name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - dockerfile: Dockerfile - snapshot: false - tags: "${{ steps.extract_branch.outputs.branch }}" - buildoptions: "--pull" + repo-token: ${{ secrets.GITHUB_TOKEN }} + pr-message: |- + congrats From 2e4903a4e3045fd59957b7f2f687fb5712344f7f Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:49:04 +0200 Subject: [PATCH 13/27] change message --- .github/workflows/test-containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index b35241a3..eb27cbc9 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -12,4 +12,4 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} pr-message: |- - congrats + congrats ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui nada From bdd549a6759944944af600509602140c518d88cb Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:56:55 +0200 Subject: [PATCH 14/27] script --- .github/workflows/test-containers.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index eb27cbc9..9cac7a5a 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -13,3 +13,13 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} pr-message: |- congrats ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui nada + - uses: actions/github-script@v4 + with: + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thanks for reporting!' + }) + repo-token: ${{ secrets.GITHUB_TOKEN }} From 33d8d36b261af7180d878fcbd65cd1f56d864240 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 18:01:23 +0200 Subject: [PATCH 15/27] change body --- .github/workflows/test-containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml index 9cac7a5a..845a0c05 100644 --- a/.github/workflows/test-containers.yml +++ b/.github/workflows/test-containers.yml @@ -20,6 +20,6 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: '👋 Thanks for reporting!' + body: '👋 Thanks for reporting! ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui' }) repo-token: ${{ secrets.GITHUB_TOKEN }} From 377de0173a950d495d4c0e1460e78560aa2ccd01 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 18:25:53 +0200 Subject: [PATCH 16/27] change body --- .../workflows/pr-build-container-images.yml | 20 +++++++++++++++ .github/workflows/test-containers.yml | 25 ------------------- 2 files changed, 20 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/pr-build-container-images.yml delete mode 100644 .github/workflows/test-containers.yml diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/pr-build-container-images.yml new file mode 100644 index 00000000..245073e2 --- /dev/null +++ b/.github/workflows/pr-build-container-images.yml @@ -0,0 +1,20 @@ +name: PR build container images + +on: + pull_request_target: + types: [opened] + +jobs: + message: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v4 + with: + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui \n To see the full set of container images generate visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' + }) + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml deleted file mode 100644 index 845a0c05..00000000 --- a/.github/workflows/test-containers.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Welcome comment - -on: - pull_request_target: - types: [opened, labeled] - -jobs: - Welcome: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - pr-message: |- - congrats ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui nada - - uses: actions/github-script@v4 - with: - script: | - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '👋 Thanks for reporting! ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui' - }) - repo-token: ${{ secrets.GITHUB_TOKEN }} From 9141ebc6cfe000e0d1d223a0655b221a7940281f Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 18:30:20 +0200 Subject: [PATCH 17/27] format --- .github/workflows/pr-build-container-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/pr-build-container-images.yml index 245073e2..a55a8904 100644 --- a/.github/workflows/pr-build-container-images.yml +++ b/.github/workflows/pr-build-container-images.yml @@ -15,6 +15,6 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui \n To see the full set of container images generate visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' + body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image ```docker pull docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui``` \n To see the full set of container images generate visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' }) repo-token: ${{ secrets.GITHUB_TOKEN }} From 9873d6d4e71f25bc1505074e95263c4e31ff2278 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 18:38:55 +0200 Subject: [PATCH 18/27] Format --- .github/workflows/pr-build-container-images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/pr-build-container-images.yml index a55a8904..2ec160e8 100644 --- a/.github/workflows/pr-build-container-images.yml +++ b/.github/workflows/pr-build-container-images.yml @@ -15,6 +15,6 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image ```docker pull docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui``` \n To see the full set of container images generate visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' + body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image ```\n docker pull docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui \n``` \n To see the full set of container images generate visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' }) - repo-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} From 27b1e83ffa621aebd31cedee661e4b6af63512a8 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 18:43:42 +0200 Subject: [PATCH 19/27] change message --- .github/workflows/pr-build-container-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/pr-build-container-images.yml index 2ec160e8..f6be9b5e 100644 --- a/.github/workflows/pr-build-container-images.yml +++ b/.github/workflows/pr-build-container-images.yml @@ -15,6 +15,6 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image ```\n docker pull docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui \n``` \n To see the full set of container images generate visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' + body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image `docker pull docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui` \n To see the full set of container images generate visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' }) github-token: ${{ secrets.GITHUB_TOKEN }} From 96e79070d63cba4694b776f173807777c6a7ab17 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 19:01:58 +0200 Subject: [PATCH 20/27] github.event.pull_request.head.repo.full_name --- .github/workflows/pr-build-container-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/pr-build-container-images.yml index f6be9b5e..99fdfe06 100644 --- a/.github/workflows/pr-build-container-images.yml +++ b/.github/workflows/pr-build-container-images.yml @@ -15,6 +15,6 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image `docker pull docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui` \n To see the full set of container images generate visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' + body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.event.pull_request.head.repo.full_name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image `docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui` \n To see the full set of container images generated visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' }) github-token: ${{ secrets.GITHUB_TOKEN }} From d3106311d378e832d07d0d19c1ad131a8e5a30f1 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 19:09:22 +0200 Subject: [PATCH 21/27] twice --- .../pr-build-container-images-comment.yml | 20 ++++++++++ .../workflows/pr-build-container-images.yml | 39 ++++++++++++------- 2 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/pr-build-container-images-comment.yml diff --git a/.github/workflows/pr-build-container-images-comment.yml b/.github/workflows/pr-build-container-images-comment.yml new file mode 100644 index 00000000..15604a6f --- /dev/null +++ b/.github/workflows/pr-build-container-images-comment.yml @@ -0,0 +1,20 @@ +name: PR build container images comment + +on: + pull_request_target: + types: [opened] + +jobs: + message: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v4 + with: + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.event.pull_request.head.repo.full_name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image `docker.pkg.github.com/${{github.event.pull_request.head.repo.full_name}}/tackle-ui` \n To see the full set of container images generated visit https://github.com/${{github.event.pull_request.head.repo.full_name}}/packages' + }) + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/pr-build-container-images.yml index 99fdfe06..7179de84 100644 --- a/.github/workflows/pr-build-container-images.yml +++ b/.github/workflows/pr-build-container-images.yml @@ -1,20 +1,33 @@ name: PR build container images -on: - pull_request_target: - types: [opened] +on: [push] jobs: - message: + container-images: + if: ${{ github.event_name != 'pull_request' && github.repository_owner != 'konveyor' }} runs-on: ubuntu-latest steps: - - uses: actions/github-script@v4 + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 with: - script: | - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.event.pull_request.head.repo.full_name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image `docker.pkg.github.com/${{github.repository_owner}}/${{github.event.repository.name}}/tackle-ui` \n To see the full set of container images generated visit https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/packages' - }) - github-token: ${{ secrets.GITHUB_TOKEN }} + node-version: 12.x + - name: Build + run: | + yarn install + yarn build + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + - name: Push to GitHub Packages + uses: elgohr/Publish-Docker-Github-Action@3.02 + with: + registry: docker.pkg.github.com + name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + dockerfile: Dockerfile + snapshot: false + tags: "${{ steps.extract_branch.outputs.branch }}" + buildoptions: "--pull" From b679e657679f41b46f21995ee502dbcbd8abddf0 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Jul 2021 19:15:14 +0200 Subject: [PATCH 22/27] branch --- .github/workflows/pr-build-container-images-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-container-images-comment.yml b/.github/workflows/pr-build-container-images-comment.yml index 15604a6f..9918fb97 100644 --- a/.github/workflows/pr-build-container-images-comment.yml +++ b/.github/workflows/pr-build-container-images-comment.yml @@ -15,6 +15,6 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.event.pull_request.head.repo.full_name}}/actions/workflows/pr-build-container-images.yml and once the build finishes you should be able to use the container image `docker.pkg.github.com/${{github.event.pull_request.head.repo.full_name}}/tackle-ui` \n To see the full set of container images generated visit https://github.com/${{github.event.pull_request.head.repo.full_name}}/packages' + body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.event.pull_request.head.repo.full_name}}/actions/workflows/pr-build-container-images.yml?query=branch%3A${{github.event.pull_request.head.ref}} and once the build finishes you should be able to use the container image `docker.pkg.github.com/${{github.event.pull_request.head.repo.full_name}}/tackle-ui:${{github.event.pull_request.head.ref}}` \n To see the full set of container images generated visit https://github.com/${{github.event.pull_request.head.repo.full_name}}/packages' }) github-token: ${{ secrets.GITHUB_TOKEN }} From 8008b83645a9e76b93fe602c30a82ffd37b1681b Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 9 Jul 2021 07:28:38 +0200 Subject: [PATCH 23/27] Change message content --- .github/workflows/pr-build-container-images-comment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-build-container-images-comment.yml b/.github/workflows/pr-build-container-images-comment.yml index 9918fb97..11075e81 100644 --- a/.github/workflows/pr-build-container-images-comment.yml +++ b/.github/workflows/pr-build-container-images-comment.yml @@ -5,16 +5,16 @@ on: types: [opened] jobs: - message: + comment: runs-on: ubuntu-latest steps: - uses: actions/github-script@v4 with: + github-token: ${{ secrets.GITHUB_TOKEN }} script: | github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Thanks for your contribution! \n Every commit will generate a new build in https://github.com/${{github.event.pull_request.head.repo.full_name}}/actions/workflows/pr-build-container-images.yml?query=branch%3A${{github.event.pull_request.head.ref}} and once the build finishes you should be able to use the container image `docker.pkg.github.com/${{github.event.pull_request.head.repo.full_name}}/tackle-ui:${{github.event.pull_request.head.ref}}` \n To see the full set of container images generated visit https://github.com/${{github.event.pull_request.head.repo.full_name}}/packages' + body: 'Thanks for your contribution! \n Every commit will generate a new build at https://github.com/${{github.event.pull_request.head.repo.full_name}}/actions/workflows/pr-build-container-images.yml?query=branch%3A${{github.event.pull_request.head.ref}} and once the build finishes you should be able to use the container image `docker.pkg.github.com/${{github.event.pull_request.head.repo.full_name}}/${{github.event.repository.name}}:${{github.event.pull_request.head.ref}}` \n To see the full set of container images generated visit https://github.com/${{github.event.pull_request.head.repo.full_name}}/packages' }) - github-token: ${{ secrets.GITHUB_TOKEN }} From 3b0e9b3632ced65953aacc27bdb0f8f97e96cdc1 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 9 Jul 2021 07:40:35 +0200 Subject: [PATCH 24/27] Change test containers name --- .github/workflows/pr-build-container-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/pr-build-container-images.yml index 7179de84..6620bf90 100644 --- a/.github/workflows/pr-build-container-images.yml +++ b/.github/workflows/pr-build-container-images.yml @@ -24,7 +24,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.02 with: registry: docker.pkg.github.com - name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui + name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.event.repository.name }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} dockerfile: Dockerfile From 6d2863c277c13eab60f42765c7031607cfed3840 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 9 Jul 2021 07:59:46 +0200 Subject: [PATCH 25/27] change image name --- .github/workflows/pr-build-container-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/pr-build-container-images.yml index 6620bf90..7179de84 100644 --- a/.github/workflows/pr-build-container-images.yml +++ b/.github/workflows/pr-build-container-images.yml @@ -24,7 +24,7 @@ jobs: uses: elgohr/Publish-Docker-Github-Action@3.02 with: registry: docker.pkg.github.com - name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.event.repository.name }} + name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} dockerfile: Dockerfile From 8adb3dc9652403cb26be2f12e40e81c3607e8aec Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 14 Jul 2021 10:38:02 +0200 Subject: [PATCH 26/27] Add template --- .../pr-build-container-images-comment.yml | 20 ------------------- ...ntainer-images.yml => test-containers.yml} | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 .github/workflows/pr-build-container-images-comment.yml rename .github/workflows/{pr-build-container-images.yml => test-containers.yml} (96%) diff --git a/.github/workflows/pr-build-container-images-comment.yml b/.github/workflows/pr-build-container-images-comment.yml deleted file mode 100644 index 11075e81..00000000 --- a/.github/workflows/pr-build-container-images-comment.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: PR build container images comment - -on: - pull_request_target: - types: [opened] - -jobs: - comment: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Thanks for your contribution! \n Every commit will generate a new build at https://github.com/${{github.event.pull_request.head.repo.full_name}}/actions/workflows/pr-build-container-images.yml?query=branch%3A${{github.event.pull_request.head.ref}} and once the build finishes you should be able to use the container image `docker.pkg.github.com/${{github.event.pull_request.head.repo.full_name}}/${{github.event.repository.name}}:${{github.event.pull_request.head.ref}}` \n To see the full set of container images generated visit https://github.com/${{github.event.pull_request.head.repo.full_name}}/packages' - }) diff --git a/.github/workflows/pr-build-container-images.yml b/.github/workflows/test-containers.yml similarity index 96% rename from .github/workflows/pr-build-container-images.yml rename to .github/workflows/test-containers.yml index 7179de84..a8b50ace 100644 --- a/.github/workflows/pr-build-container-images.yml +++ b/.github/workflows/test-containers.yml @@ -1,4 +1,4 @@ -name: PR build container images +name: Test containers on: [push] From bc34fbe396e73201e2b99fa2c314bc073e41cbfe Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 14 Jul 2021 16:42:34 +0200 Subject: [PATCH 27/27] Disable ipv6 through env var --- entrypoint.sh | 7 ++++++- nginx.conf.template | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index cea3304a..4b633504 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -30,9 +30,14 @@ if [[ -z "$SSO_CLIENT_ID" ]]; then exit 1 fi +export LISTEN_IPV6="listen [::]:8080 default_server;" +if [ "$DISABLE_IPV6" = true ] ; then + export LISTEN_IPV6="# ${LISTEN_IPV6}" +fi + if [ -f ./nginx.conf.template ]; then echo "---> Processing nginx.conf.template configuration file..." - envsubst '${CONTROLS_API_URL} ${SSO_SERVER_URL} ${APPLICATION_INVENTORY_API_URL} ${PATHFINDER_API_URL}' < ./nginx.conf.template > ./nginx.conf + envsubst '${LISTEN_IPV6} ${CONTROLS_API_URL} ${SSO_SERVER_URL} ${APPLICATION_INVENTORY_API_URL} ${PATHFINDER_API_URL}' < ./nginx.conf.template > ./nginx.conf cp -v ./nginx.conf "${NGINX_CONF_PATH}" rm -f ./nginx.conf fi diff --git a/nginx.conf.template b/nginx.conf.template index 82da1e21..2bafb8de 100644 --- a/nginx.conf.template +++ b/nginx.conf.template @@ -40,7 +40,7 @@ http { server { listen 8080 default_server; - listen [::]:8080 default_server; + ${LISTEN_IPV6} server_name _; root /opt/app-root/src;