-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (56 loc) · 3.05 KB
/
create-environment.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
# Add a new environment to this repo's stack
name: Create an environment
on:
# This workflow is always manually executed.
workflow_dispatch:
inputs:
environmentName:
description: "Name of environment to create:"
required: true
sandboxName:
description: "Name of environment's sandbox:"
required: true
access:
description: "Name of the public group whose members can access the sandbox. This is only required if you are not using a pre-existing sandbox:"
required: false
branchName:
description: "Name of environment's Git branch:"
required: true
# This action uses GitHub's built in token authentication for Git repositories.
# Read more at https://docs.github.com/en/actions/security-guides/automatic-token-authentication.
permissions:
# Ensure that OrgFlow can push the new branch back to the remote repository:
contents: write
jobs:
env-create:
name: Create environment
runs-on: ubuntu-latest
steps:
# Verify secrets:
- name: Verify secrets
run: |
if ["${{ secrets.ORGFLOW_STACKNAME }}" == ""]; then echo "::error title=Missing input value::Repository secret ORGFLOW_STACKNAME has not been set. See the Readme for more details." && exit 1; fi;
if ["${{ secrets.ORGFLOW_LICENSEKEY }}" == ""]; then echo "::error title=Missing input value::Repository secret ORGFLOW_LICENSEKEY has not been set. See the Readme for more details." && exit 1; fi;
if ["${{ secrets.SALESFORCE_USERNAME }}" == ""]; then echo "::error title=Missing input value::Repository secret SALESFORCE_USERNAME has not been set. See the Readme for more details." && exit 1; fi;
if ["${{ secrets.SALESFORCE_PASSWORD }}" == ""]; then echo "::error title=Missing input value::Repository secret SALESFORCE_PASSWORD has not been set. See the Readme for more details." && exit 1; fi;
# Install and configure OrgFlow:
- name: Install OrgFlow
uses: orgflow-actions/setup@v1
with:
version: 3
license-key: ${{ secrets.ORGFLOW_LICENSEKEY }}
salesforce-username: ${{ secrets.SALESFORCE_USERNAME }}
salesforce-password: ${{ secrets.SALESFORCE_PASSWORD }}
git-username: ${{ github.actor }}
git-password: ${{ secrets.GITHUB_TOKEN }}
stack-name: ${{ secrets.ORGFLOW_STACKNAME }}
env:
ORGFLOW__ACCEPTEULA: "true"
# Run OrgFlow command to create environment:
- name: Run env:create
run: |
orgflow env:create --environment="${{ github.event.inputs.environmentName }}" --sandboxName="${{ github.event.inputs.sandboxName }}" --access="${{ github.event.inputs.access }}" --branchName="${{ github.event.inputs.branchName }}" --useExistingSandbox --useExistingBranch --noConfirm --waitForLock=5
# Tag this environment so that the upstream merge workflow can filter based on this tag:
- name: Run env:tags:set
run: |
orgflow env:tags:set --environment="${{ github.event.inputs.environmentName }}" --tags="upstreamMergeTarget"