Skip to content

Commit 0cb9ffc

Browse files
committed
Merge branch 'seth/drone-trigger-gh-actions'
2 parents 357f53e + 27992ba commit 0cb9ffc

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.drone.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
2-
32
kind: pipeline
43
type: docker
54
name: on-droneci-complete
65
clone:
76
disable: true
87
steps:
8+
- name: print-build-status
9+
image: alpine
10+
commands:
11+
- echo "DRONE_BUILD_STATUS=$DRONE_BUILD_STATUS"
12+
913
- name: trigger-github-actions
1014
image: plugins/webhook
1115
settings:
@@ -15,12 +19,13 @@ steps:
1519
secrets:
1620
- source: on-droneci-complete-github-token
1721
target: webhook_password
22+
content_type: application/json
1823
template: |
1924
{
2025
"ref": "{{ build.branch }}",
2126
"inputs": {
2227
"github_sha": "{{ build.commit }}",
23-
"drone_succeeded": {{ eq build.status 'success' }}
28+
"drone_build_status": "{{ build.status }}",
2429
}
2530
}
2631
debug: true
@@ -32,6 +37,6 @@ trigger:
3237
- pull_request
3338
---
3439
kind: signature
35-
hmac: 64f80f45bacfea906a0a36dedfb08b3f5c8394d2aacfb182e6104300965e2bb5
40+
hmac: 52eb4a39f30b611ecc75ad2636322ff338d904ede0f4ae6f09b6d033cbcf6aee
3641

3742
...

.github/workflows/on-droneci-complete.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
github_sha:
77
description: "equivalent to github.sha in an ordinary workflow"
88
required: true
9-
drone_succeeded:
10-
description: "did drone tests pass or fail?"
9+
drone_build_status:
1110
required: true
12-
type: boolean
11+
type: choice
12+
options:
13+
- success
14+
- failure
1315

1416
permissions:
1517
statuses: write
@@ -18,7 +20,7 @@ jobs:
1820
# This one should pass
1921
cms-followup:
2022
runs-on: ubuntu-24.04
21-
if: ${{ inputs.drone_succeeded }}
23+
if: ${{ inputs.drone_build_status == 'success' }}
2224
# uses: ./.github/workflows/cms-followup.yml
2325
steps:
2426
- run: |
@@ -43,7 +45,7 @@ jobs:
4345
# This one should fail
4446
k8s-followup:
4547
runs-on: ubuntu-24.04
46-
if: ${{ inputs.drone_succeeded }}
48+
if: ${{ inputs.drone_build_status == 'success' }}
4749
# uses: ./.github/workflows/k8s-followup.yml
4850
steps:
4951
- run: |

0 commit comments

Comments
 (0)