-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
93 lines (85 loc) · 3.04 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Run Scratch Org Flow
description: 'Execute a named CumulusCI flow'
inputs:
cumulusci-version:
description: 'version of CumulusCI to install'
required: false
sfdx-version:
description: 'version of SFDX to install'
required: false
dev-hub-auth-url:
description: 'SFDX auth URL for the Dev Hub'
required: true
cumulusci-service-github:
description: 'Value for CUMULUSCI_SERVICE_github'
required: true
org-name:
description: 'Name of the scratch org or persistent org config to use'
required: true
flow-name:
description: 'Name of the Cumulus flow to execute'
required: true
flow-task-options:
description: 'Task options passed to the flow'
required: false
commit-status-name:
description: 'Name of an optional extra commit status to set from build results'
required: false
default:
commit-status-regex:
description: 'Regex to apply to flow log to locate commit status value'
required: false
default:
commit-status-description-prefix:
description: 'Value to prefix before regex result in commit status value'
required: false
default:
outputs:
error-message:
description: "Error message returned by the flow, if any"
value: ${{ steps.run-flow.outputs.error-message }}
package-version:
description: "Package version number mentioned (created or failed creation)"
value: ${{ steps.run-flow.outputs.package-version }}
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Set Up CumulusCI
#uses: RupertBarrow/setup-cumulus@rb/upgrade-to-setup-python-v_4_5_0
uses: cumulus-actions/setup-cumulus@v1
with:
cumulusci-version: '${{ inputs.cumulusci-version }}'
sfdx-version: '${{ inputs.sfdx-version }}'
- name: Authorize Dev Hub
uses: cumulus-actions/authorize-org@v1
with:
auth-url: '${{ inputs.dev-hub-auth-url }}'
org-name: dev-hub
dev-hub: true
- name: Run Flow
uses: RupertBarrow/cumulus-action-run-flow@v1
with:
cumulusci-service-github: '${{ inputs.cumulusci-service-github }}'
org-name: '${{ inputs.org-name }}'
flow-name: '${{ inputs.flow-name }}'
flow-task-options: '${{ inputs.flow-task-options }}'
- name: Set Commit Status
if: ${{ inputs.commit-status-regex && inputs.commit-status-name }}
env:
GITHUB_TOKEN: '${{ github.token }}'
run: |
STATUS=$(cat cumulusci-flow.log | grep -o '${{ inputs.commit-status-regex }}')
gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
'/repos/${{ github.repository }}/statuses/${{ github.sha }}' \
-f state='success' \
-f description="${{ inputs.commit-status-description-prefix }}$STATUS" \
-f context='${{ inputs.commit-status-name }}'
shell: bash
- name: Delete Scratch Org
if: ${{ always() }}
continue-on-error: true
shell: bash
run: cci org scratch_delete ${{ inputs.org-name }} || true