From 3148a2181753ee40668433df7294131f35af4e1c Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 19:19:27 -1000 Subject: [PATCH 01/16] on-branch.txt --- on-branch.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 on-branch.txt diff --git a/on-branch.txt b/on-branch.txt new file mode 100644 index 0000000..56f1318 --- /dev/null +++ b/on-branch.txt @@ -0,0 +1 @@ +this is branch seth/drone-trigger-gh-actions.txt \ No newline at end of file From 8b54c5608e59f9152210188620ab5450cab683c8 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 19:32:51 -1000 Subject: [PATCH 02/16] on-branch.txt: add 'and stuff' --- on-branch.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/on-branch.txt b/on-branch.txt index 56f1318..7549f30 100644 --- a/on-branch.txt +++ b/on-branch.txt @@ -1 +1 @@ -this is branch seth/drone-trigger-gh-actions.txt \ No newline at end of file +this is branch seth/drone-trigger-gh-actions.txt and stuff \ No newline at end of file From 0a2c77f45682cd0fb8e841f50313f3f47ec6e793 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 19:45:58 -1000 Subject: [PATCH 03/16] try using new drone secret syntax --- .drone.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8da8575..9067ecf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,9 +16,11 @@ steps: urls: - https://api.github.com/repos/code-dot-org/test-workflow-dispatch/actions/workflows/on-droneci-complete.yml/dispatches username: x-access-token - secrets: - - source: on-droneci-complete-github-token - target: webhook_password + password: + from_secret: on-droneci-complete-github-token + # secrets: + # - source: on-droneci-complete-github-token + # target: webhook_password content_type: application/json template: | { @@ -37,6 +39,6 @@ trigger: - pull_request --- kind: signature -hmac: 52eb4a39f30b611ecc75ad2636322ff338d904ede0f4ae6f09b6d033cbcf6aee +hmac: a2f6c1da8f148ba1662efa0924bae18ab2ec9504f83808ae6fb6544584e286ee ... From 1d75401c263abdd73dc4770fc4db06782868ce93 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 19:49:18 -1000 Subject: [PATCH 04/16] json no like trailing comma --- .drone.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9067ecf..7f393f1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,16 +18,13 @@ steps: username: x-access-token password: from_secret: on-droneci-complete-github-token - # secrets: - # - source: on-droneci-complete-github-token - # target: webhook_password content_type: application/json template: | { "ref": "{{ build.branch }}", "inputs": { "github_sha": "{{ build.commit }}", - "drone_build_status": "{{ build.status }}", + "drone_build_status": "{{ build.status }}" } } debug: true From 6cb0c54e21448eb416532c2432215a2f513c7d5c Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 19:53:43 -1000 Subject: [PATCH 05/16] .drone.yml: remove debug steps --- .drone.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7f393f1..0e24a8a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,20 +5,13 @@ name: on-droneci-complete clone: disable: true steps: - - name: print-build-status - image: alpine - commands: - - echo "DRONE_BUILD_STATUS=$DRONE_BUILD_STATUS" - - name: trigger-github-actions image: plugins/webhook settings: urls: - https://api.github.com/repos/code-dot-org/test-workflow-dispatch/actions/workflows/on-droneci-complete.yml/dispatches - username: x-access-token password: from_secret: on-droneci-complete-github-token - content_type: application/json template: | { "ref": "{{ build.branch }}", @@ -36,6 +29,6 @@ trigger: - pull_request --- kind: signature -hmac: a2f6c1da8f148ba1662efa0924bae18ab2ec9504f83808ae6fb6544584e286ee +hmac: 00bf975fb7ec8f2fd04d17334f1437085a3d81c0fec42bb22b2a307f77359b13 ... From 9b0c67d821951218d86901a14bc5bd21190c42b1 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 19:54:45 -1000 Subject: [PATCH 06/16] on-droneci-complete.yml: verify runs branch-version not main branch version --- .github/workflows/on-droneci-complete.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-droneci-complete.yml b/.github/workflows/on-droneci-complete.yml index f10cbd8..0edf68a 100644 --- a/.github/workflows/on-droneci-complete.yml +++ b/.github/workflows/on-droneci-complete.yml @@ -35,7 +35,7 @@ jobs: script: | await github.rest.repos.createCommitStatus({ context: 'CMS Followup', - description: 'blah blah blah', + description: 'this job should succeed', owner: context.repo.owner, repo: context.repo.repo, sha: '${{ inputs.github_sha }}', @@ -63,7 +63,7 @@ jobs: script: | await github.rest.repos.createCommitStatus({ context: 'K8S Followup', - description: 'blah blah blah', + description: 'this job should fail', owner: context.repo.owner, repo: context.repo.repo, sha: '${{ inputs.github_sha }}', From 773786c035ed8249347d1b78996d4a73d1683143 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:05:00 -1000 Subject: [PATCH 07/16] .drone.yml: username: deploy-code-org --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 0e24a8a..c266315 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,6 +10,7 @@ steps: settings: urls: - https://api.github.com/repos/code-dot-org/test-workflow-dispatch/actions/workflows/on-droneci-complete.yml/dispatches + username: deploy-code-org password: from_secret: on-droneci-complete-github-token template: | @@ -29,6 +30,6 @@ trigger: - pull_request --- kind: signature -hmac: 00bf975fb7ec8f2fd04d17334f1437085a3d81c0fec42bb22b2a307f77359b13 +hmac: 7315f7e73ed32564a359ef6256f6c0dcfe7b5c3ca5d3256c2e999888b545ae14 ... From dc9bb6bd3e503d7f1f4ae565dc4bf17870e0358c Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:07:12 -1000 Subject: [PATCH 08/16] .drone.yml: disable debug: true on gh actions trigger --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c266315..84e00ed 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,7 +21,6 @@ steps: "drone_build_status": "{{ build.status }}" } } - debug: true # depends_on: # - unit # - ui From af42b19308e634d576ce502263cd6d9ccf28da75 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:09:16 -1000 Subject: [PATCH 09/16] drone_chill_status (experiment) --- .github/workflows/on-droneci-complete.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on-droneci-complete.yml b/.github/workflows/on-droneci-complete.yml index 0edf68a..7c0c02d 100644 --- a/.github/workflows/on-droneci-complete.yml +++ b/.github/workflows/on-droneci-complete.yml @@ -6,7 +6,7 @@ on: github_sha: description: "equivalent to github.sha in an ordinary workflow" required: true - drone_build_status: + drone_chill_status: required: true type: choice options: @@ -20,7 +20,7 @@ jobs: # This one should pass cms-followup: runs-on: ubuntu-24.04 - if: ${{ inputs.drone_build_status == 'success' }} + if: ${{ inputs.drone_chill_status == 'success' }} # uses: ./.github/workflows/cms-followup.yml steps: - run: | @@ -45,7 +45,7 @@ jobs: # This one should fail k8s-followup: runs-on: ubuntu-24.04 - if: ${{ inputs.drone_build_status == 'success' }} + if: ${{ inputs.drone_chill_status == 'success' }} # uses: ./.github/workflows/k8s-followup.yml steps: - run: | From 5b1d5e7150bc61c652b2e5bbf0b76611933a56a2 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:10:46 -1000 Subject: [PATCH 10/16] on-droneci-complete.yml: restore --- .github/workflows/on-droneci-complete.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on-droneci-complete.yml b/.github/workflows/on-droneci-complete.yml index 7c0c02d..0edf68a 100644 --- a/.github/workflows/on-droneci-complete.yml +++ b/.github/workflows/on-droneci-complete.yml @@ -6,7 +6,7 @@ on: github_sha: description: "equivalent to github.sha in an ordinary workflow" required: true - drone_chill_status: + drone_build_status: required: true type: choice options: @@ -20,7 +20,7 @@ jobs: # This one should pass cms-followup: runs-on: ubuntu-24.04 - if: ${{ inputs.drone_chill_status == 'success' }} + if: ${{ inputs.drone_build_status == 'success' }} # uses: ./.github/workflows/cms-followup.yml steps: - run: | @@ -45,7 +45,7 @@ jobs: # This one should fail k8s-followup: runs-on: ubuntu-24.04 - if: ${{ inputs.drone_chill_status == 'success' }} + if: ${{ inputs.drone_build_status == 'success' }} # uses: ./.github/workflows/k8s-followup.yml steps: - run: | From a6d44515a724db408243fd58e3c4223d275bcc48 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:18:05 -1000 Subject: [PATCH 11/16] .drone.yml: use build.source instead of build.branch --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 84e00ed..31acdee 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,7 +15,7 @@ steps: from_secret: on-droneci-complete-github-token template: | { - "ref": "{{ build.branch }}", + "ref": "{{ build.source }}", "inputs": { "github_sha": "{{ build.commit }}", "drone_build_status": "{{ build.status }}" From d6edc548b4ad6fcdec565775e0ffbada02198a62 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:23:10 -1000 Subject: [PATCH 12/16] debug: true --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 31acdee..9c9e8ee 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,6 +21,7 @@ steps: "drone_build_status": "{{ build.status }}" } } + debug: true # depends_on: # - unit # - ui From ccf5bf22edbf9a42d2e9f56cbe94e58733777ec6 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:31:32 -1000 Subject: [PATCH 13/16] idk? `"source-branch": "${DRONE_SOURCE_BRANCH}",` --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 9c9e8ee..605cc1d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,6 +16,7 @@ steps: template: | { "ref": "{{ build.source }}", + "source-branch": "${DRONE_SOURCE_BRANCH}", "inputs": { "github_sha": "{{ build.commit }}", "drone_build_status": "{{ build.status }}" From f111ffae0284fcadcdb0afe90c123341333f74a5 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:39:51 -1000 Subject: [PATCH 14/16] with no template, what values do we have?? --- .drone.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 605cc1d..466a658 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,15 +13,7 @@ steps: username: deploy-code-org password: from_secret: on-droneci-complete-github-token - template: | - { - "ref": "{{ build.source }}", - "source-branch": "${DRONE_SOURCE_BRANCH}", - "inputs": { - "github_sha": "{{ build.commit }}", - "drone_build_status": "{{ build.status }}" - } - } + debug: true # depends_on: # - unit From f2b0ed84aa13a2de0ba32ee54649847b10fa58c7 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 20:55:50 -1000 Subject: [PATCH 15/16] use ${DRONE_SOURCE_BRANCH} for the ref --- .drone.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 466a658..822cd4e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,14 @@ steps: username: deploy-code-org password: from_secret: on-droneci-complete-github-token - + template: | + { + "ref": "${DRONE_SOURCE_BRANCH}", + "inputs": { + "github_sha": "{{ build.commit }}", + "drone_build_status": "{{ build.status }}" + } + } debug: true # depends_on: # - unit From c0ee1856ea2d7da5863a3ad7aa1172f34cf60264 Mon Sep 17 00:00:00 2001 From: Seth Nickell Date: Tue, 8 Apr 2025 21:00:33 -1000 Subject: [PATCH 16/16] turn off debug, cause stuff --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 822cd4e..bdedb64 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,7 +21,6 @@ steps: "drone_build_status": "{{ build.status }}" } } - debug: true # depends_on: # - unit # - ui