Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-use scratch orgs by CI/CD #53

Open
kryvyifedir opened this issue Jul 21, 2023 · 0 comments
Open

Re-use scratch orgs by CI/CD #53

kryvyifedir opened this issue Jul 21, 2023 · 0 comments

Comments

@kryvyifedir
Copy link
Owner

CI/CD shouldn't create new scratch org for each modification of the PR. Instead it should create an org and re-use it if possible.
Org can be named using PR number, and found by this command:
(Note, JQ is needed)
- name: List all orgs
run: |
sf org list --json --all --skip-connection-status | jq . > sfOrgList.json
cat sfOrgList.json
jq ".result.scratchOrgs | .[] | select(.alias == "build_${{ github.event.pull_request.number }}")'" sfOrgList.json > scratch.json
cat scratch.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant