From ff0081e96b397a7d3fd170ebfb3339fd5095b408 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Tue, 31 Oct 2023 15:40:26 -0500 Subject: [PATCH] Add create-scratch-org workflow --- .../workflows/create-scratch-unmanaged.yml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/create-scratch-unmanaged.yml diff --git a/.github/workflows/create-scratch-unmanaged.yml b/.github/workflows/create-scratch-unmanaged.yml new file mode 100644 index 0000000..80283b0 --- /dev/null +++ b/.github/workflows/create-scratch-unmanaged.yml @@ -0,0 +1,63 @@ +name: 2GP Feature Test + +on: + workflow_call: + inputs: + debug: + required: false + default: false + type: boolean + + secrets: + # Either dev-hub-auth-url or dev-hub-username, dev-hub-client-id, and dev-hub-private-key are required + dev-hub-auth-url: + required: false + dev-hub-username: + required: false + dev-hub-client-id: + required: false + dev-hub-private-key: + required: false + gh-email: + required: true + github-token: + required: true + +jobs: + feature-test: + name: "2GP Feature Test" + runs-on: ubuntu-latest + container: + image: ghcr.io/muselab-d2x/d2x:prototype + options: --user root + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github-token }} + env: + DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}" + DEV_HUB_USERNAME: "${{ secrets.dev-hub-username }}" + DEV_HUB_CLIENT_ID: "${{ secrets.dev-hub-client-id }}" + DEV_HUB_PRIVATE_KEY: "${{ secrets.dev-hub-private-key }}" + CUMULUSCI_SERVICE_github: "{ \"username\": \"${{ github.actor }}\", \"token\": \"${{ secrets.github-token }}\", \"email\": \"${{ secrets.gh-email }}\" }" + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Auth to DevHub + run: /usr/local/bin/devhub.sh + - name: Set feature org as default org + run: cci org default feature + - name: Configure for Apex Tests + env: + GITHUB_TOKEN: '${{ secrets.github-token }}' + run: cci org info + shell: bash + - name: Save Scratch Org + if: ${{ always() }} + run: | + cci org github_export ${{ github.sha }}_feature feature + shell: bash + #- name: Delete Scratch Org + # if: ${{ always() }} + # run: | + # cci org scratch_delete feature + # shell: bash