From f686bbc10deea6aaf5591f108617b149e53929a1 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 10:15:21 -0500 Subject: [PATCH 01/13] fix gh token var --- .github/workflows/build-ylem-container-prod-env.yaml | 2 +- .github/workflows/build-ylem-container-test-env.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ylem-container-prod-env.yaml b/.github/workflows/build-ylem-container-prod-env.yaml index f89649d..9e7b850 100644 --- a/.github/workflows/build-ylem-container-prod-env.yaml +++ b/.github/workflows/build-ylem-container-prod-env.yaml @@ -14,7 +14,7 @@ jobs: uses: actions/github-script@v6 with: script: | - const { GITHUB_TOKEN } = process.env; + const { GH_TOKEN } = process.env; await github.repos.createDispatchEvent({ owner: 'tloncorp', repo: 'ylem', diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index f73a7e0..6bc6ef7 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -11,7 +11,7 @@ jobs: uses: actions/github-script@v6 with: script: | - const { GITHUB_TOKEN } = process.env; + const { GH_TOKEN } = process.env; await github.repos.createDispatchEvent({ owner: 'tloncorp', repo: 'ylem', From ddf78990e2a5810bbb2fbd916280601938aaf9ae Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 10:21:08 -0500 Subject: [PATCH 02/13] fix gh token var --- .github/workflows/build-ylem-container-prod-env.yaml | 6 ++++-- .github/workflows/build-ylem-container-test-env.yaml | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ylem-container-prod-env.yaml b/.github/workflows/build-ylem-container-prod-env.yaml index 9e7b850..575bee5 100644 --- a/.github/workflows/build-ylem-container-prod-env.yaml +++ b/.github/workflows/build-ylem-container-prod-env.yaml @@ -12,10 +12,12 @@ jobs: steps: - name: Send repository dispatch to ylem (prod) uses: actions/github-script@v6 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: script: | - const { GH_TOKEN } = process.env; - await github.repos.createDispatchEvent({ + const { GITHUB_TOKEN } = process.env; + await github.rest.actions.createDispatchEvent({ owner: 'tloncorp', repo: 'ylem', event_type: 'prod-breach-ship-docker', diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index 6bc6ef7..9fd4c06 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -1,4 +1,4 @@ -name: Trigger internal azimuth-cli prod build +name: Trigger internal azimuth-cli test build on: workflow_dispatch: @@ -9,10 +9,12 @@ jobs: steps: - name: Send repository dispatch to ylem (test) uses: actions/github-script@v6 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: script: | - const { GH_TOKEN } = process.env; - await github.repos.createDispatchEvent({ + const { GITHUB_TOKEN } = process.env; + await github.rest.actions.createDispatchEvent({ owner: 'tloncorp', repo: 'ylem', event_type: 'test-breach-ship-docker', From 5d4489ab3798533f9db1e07722b5639b53a8500a Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 10:22:55 -0500 Subject: [PATCH 03/13] fix gh token var --- .github/workflows/build-ylem-container-test-env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index 9fd4c06..23f6c2e 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -1,4 +1,4 @@ -name: Trigger internal azimuth-cli test build +name: Trigger internal azimuth-cli prod build on: workflow_dispatch: From d3ba361d9f4b175b2834c912c1b709865dcf8fd2 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 10:32:14 -0500 Subject: [PATCH 04/13] use alternate dispatch action --- .../build-ylem-container-test-env.yaml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index 23f6c2e..5db449e 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -1,4 +1,4 @@ -name: Trigger internal azimuth-cli prod build +name: Trigger internal azimuth-cli test build on: workflow_dispatch: @@ -7,16 +7,9 @@ jobs: trigger-test: runs-on: ubuntu-latest steps: - - name: Send repository dispatch to ylem (test) - uses: actions/github-script@v6 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Internal test build + uses: peter-evans/repository-dispatch@v3 with: - script: | - const { GITHUB_TOKEN } = process.env; - await github.rest.actions.createDispatchEvent({ - owner: 'tloncorp', - repo: 'ylem', - event_type: 'test-breach-ship-docker', - client_payload: { branch: 'main' } - }); + token: ${{ secrets.GH_TOKEN }} + repository: tloncorp/ylem + event-type: test-breach-docker-ship From 3fed72b08d32156bd99b0b3b2ef91d3924f5b397 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 10:34:56 -0500 Subject: [PATCH 05/13] use alternative dispatch action --- .../build-ylem-container-prod-env.yaml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-ylem-container-prod-env.yaml b/.github/workflows/build-ylem-container-prod-env.yaml index 575bee5..cef9410 100644 --- a/.github/workflows/build-ylem-container-prod-env.yaml +++ b/.github/workflows/build-ylem-container-prod-env.yaml @@ -10,16 +10,9 @@ jobs: trigger-prod: runs-on: ubuntu-latest steps: - - name: Send repository dispatch to ylem (prod) - uses: actions/github-script@v6 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Internal prod build + uses: peter-evans/repository-dispatch@v3 with: - script: | - const { GITHUB_TOKEN } = process.env; - await github.rest.actions.createDispatchEvent({ - owner: 'tloncorp', - repo: 'ylem', - event_type: 'prod-breach-ship-docker', - client_payload: { branch: 'main' } - }); + token: ${{ secrets.GH_TOKEN }} + repository: "tloncorp/ylem" + event-type: prod-breach-docker-ship From 766e1f5763f0ef5bcfa9aeb0ab2521bd3f87862f Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 10:52:17 -0500 Subject: [PATCH 06/13] use github-script --- .../workflows/build-ylem-container-test-env.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index 5db449e..0745f71 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -8,8 +8,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Internal test build - uses: peter-evans/repository-dispatch@v3 + uses: actions/github-script@v7 with: - token: ${{ secrets.GH_TOKEN }} - repository: tloncorp/ylem - event-type: test-breach-docker-ship + github-token: ${{secrets.GH_TOKEN}} + script: | + await github.rest.repos.createDispatchEvent({ + owner: 'tloncorp', + repo: 'ylem', + event_type: 'test-breach-ship-docker', + client_payload: { branch: 'main' } + }); From 9e5c247bbd371928ad09f34307777a2658b77617 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 10:57:57 -0500 Subject: [PATCH 07/13] fallback token --- .github/workflows/build-ylem-container-test-env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index 0745f71..d2758ab 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -10,7 +10,7 @@ jobs: - name: Internal test build uses: actions/github-script@v7 with: - github-token: ${{secrets.GH_TOKEN}} + github-token: ${{ secrets.GH_TOKEN || github.token }} script: | await github.rest.repos.createDispatchEvent({ owner: 'tloncorp', From 81fd7d6216be9890c976f144ba9cc91979201f63 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 10:59:55 -0500 Subject: [PATCH 08/13] fallback token --- .github/workflows/build-ylem-container-test-env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index d2758ab..fca4264 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -10,7 +10,7 @@ jobs: - name: Internal test build uses: actions/github-script@v7 with: - github-token: ${{ secrets.GH_TOKEN || github.token }} + github-token: ${{ secrets.GH }} script: | await github.rest.repos.createDispatchEvent({ owner: 'tloncorp', From dc584f592e4f2c030087d1ce78b4e4de700e4ce1 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 11:17:49 -0500 Subject: [PATCH 09/13] fallback token --- .github/workflows/build-ylem-container-test-env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index fca4264..a7909b2 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -10,7 +10,7 @@ jobs: - name: Internal test build uses: actions/github-script@v7 with: - github-token: ${{ secrets.GH }} + github-token: ${{ github.token }} script: | await github.rest.repos.createDispatchEvent({ owner: 'tloncorp', From 734d0b8c414d1505bec0b85e5683554a47fd8275 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 11:21:17 -0500 Subject: [PATCH 10/13] pat token --- .github/workflows/build-ylem-container-test-env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index a7909b2..2774ce3 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -10,7 +10,7 @@ jobs: - name: Internal test build uses: actions/github-script@v7 with: - github-token: ${{ github.token }} + github-token: ${{ secrets.GH_TOKEN }} script: | await github.rest.repos.createDispatchEvent({ owner: 'tloncorp', From 97d1551711388e6cad062dc9079e44d79da7dbe5 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 11:28:22 -0500 Subject: [PATCH 11/13] add environment --- .github/workflows/build-ylem-container-test-env.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index 2774ce3..cf6f557 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -4,6 +4,7 @@ on: workflow_dispatch: jobs: + environment: test trigger-test: runs-on: ubuntu-latest steps: From 888141657e506976b8310170ca27b88f7502b34a Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 11:29:17 -0500 Subject: [PATCH 12/13] add environment --- .github/workflows/build-ylem-container-test-env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ylem-container-test-env.yaml b/.github/workflows/build-ylem-container-test-env.yaml index cf6f557..38b8f83 100644 --- a/.github/workflows/build-ylem-container-test-env.yaml +++ b/.github/workflows/build-ylem-container-test-env.yaml @@ -4,8 +4,8 @@ on: workflow_dispatch: jobs: - environment: test trigger-test: + environment: test runs-on: ubuntu-latest steps: - name: Internal test build From 0abb055e51c9713fc75d75751ebfa488f575edf2 Mon Sep 17 00:00:00 2001 From: reid Date: Wed, 23 Oct 2024 12:03:42 -0500 Subject: [PATCH 13/13] fix prod autobuild for container --- .../workflows/build-ylem-container-prod-env.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ylem-container-prod-env.yaml b/.github/workflows/build-ylem-container-prod-env.yaml index cef9410..b0be676 100644 --- a/.github/workflows/build-ylem-container-prod-env.yaml +++ b/.github/workflows/build-ylem-container-prod-env.yaml @@ -7,12 +7,18 @@ on: - solaris jobs: - trigger-prod: + trigger-test: + environment: prod runs-on: ubuntu-latest steps: - name: Internal prod build - uses: peter-evans/repository-dispatch@v3 + uses: actions/github-script@v7 with: - token: ${{ secrets.GH_TOKEN }} - repository: "tloncorp/ylem" - event-type: prod-breach-docker-ship + github-token: ${{ secrets.GH_TOKEN }} + script: | + await github.rest.repos.createDispatchEvent({ + owner: 'tloncorp', + repo: 'ylem', + event_type: 'prod-breach-ship-docker', + client_payload: { branch: 'main' } + });