From fc398e122c351caa68039453deb5dcbf54d786f9 Mon Sep 17 00:00:00 2001 From: tarcan-gul Date: Tue, 26 Dec 2023 10:28:36 -0500 Subject: [PATCH 1/2] Make the secret variable name a little general, changed the values to be devhub in main branch --- .github/workflows/e2etest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index 3254efdc..005bf1df 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -8,8 +8,8 @@ jobs: e2e-test: runs-on: ubuntu-latest env: - DEVHUB_USERNAME: ${{ secrets.PATCH_DEVHUB_USERNAME }} - DEVHUB_AUTH: ${{ secrets.PATCH_DEVHUB_AUTH }} + DEVHUB_USERNAME: ${{ secrets.DEVHUB_USERNAME }} + DEVHUB_AUTH: ${{ secrets.DEVHUB_AUTH }} PR_NUMBER: ${{ github.event.pull_request.number }} steps: - name: Checkout @@ -57,6 +57,6 @@ jobs: - name: Create B2B Aura Store env: SCRATCH_ORG_USERNAME: ${{ steps.scratch-org-step.outputs.USERNAME }} - run: ./bin/run commerce:store:create -o b2b -t "B2B Commerce (Aura)" -n b2baurastore01 -b b2cbuyer@commerce.com -v ${{ env.DEVHUB_USERNAME }} -u ${{ env.SCRATCH_ORG_USERNAME }} --json + run: ./bin/run commerce:store:create -o b2b -t "B2B Commerce (Aura)" -n b2baurastore01 -b b2baurabuyer@commerce.com -v ${{ env.DEVHUB_USERNAME }} -u ${{ env.SCRATCH_ORG_USERNAME }} --json - name: Confirmation run: echo "All stores are created!" \ No newline at end of file From dcec29c18a79890c249f1346b4cefd383715ae38 Mon Sep 17 00:00:00 2001 From: tarcan-gul Date: Tue, 26 Dec 2023 10:47:52 -0500 Subject: [PATCH 2/2] Fixed the scratchorg removal if block, exit code shouldn't be 1 now --- .github/workflows/closePR.yml | 2 +- .github/workflows/e2etest.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/closePR.yml b/.github/workflows/closePR.yml index 8c06710a..c60bf342 100644 --- a/.github/workflows/closePR.yml +++ b/.github/workflows/closePR.yml @@ -28,5 +28,5 @@ jobs: - name: Cleanup the last created scratch org for the PR CI run: | LAST_SCRATCH_ID=`sf data query --query "SELECT Id FROM ActiveScratchOrg WHERE SignupUsername LIKE '%pr${{ env.PR_NUMBER }}%'" -o ${{ env.DEVHUB_USERNAME }} --json | jq -r '.result.records[0].Id'` - [ "$LAST_SCRATCH_ID" != "null" ] && sf data delete record -s ActiveScratchOrg -o ${{ env.DEVHUB_USERNAME }} -i $LAST_SCRATCH_ID + if [ "$LAST_SCRATCH_ID" != "null" ]; then sf data delete record -s ActiveScratchOrg -o ${{ env.DEVHUB_USERNAME }} -i $LAST_SCRATCH_ID; else echo 'No scratch org needs to be deleted.'; fi \ No newline at end of file diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index 005bf1df..fc28dc2e 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -32,10 +32,9 @@ jobs: echo ${{ env.DEVHUB_AUTH }} > authFile sf force auth sfdxurl store -f 'authFile' - name: Cleanup The Latest Scratch Org From This Pull Request - continue-on-error: true run: | LAST_SCRATCH_ID=`sf data query --query "SELECT Id FROM ActiveScratchOrg WHERE SignupUsername LIKE '%pr${{ env.PR_NUMBER }}%'" -o ${{ env.DEVHUB_USERNAME }} --json | jq -r '.result.records[0].Id'` - [ "$LAST_SCRATCH_ID" != "null" ] && sf data delete record -s ActiveScratchOrg -o ${{ env.DEVHUB_USERNAME }} -i $LAST_SCRATCH_ID + if [ "$LAST_SCRATCH_ID" != "null" ]; then sf data delete record -s ActiveScratchOrg -o ${{ env.DEVHUB_USERNAME }} -i $LAST_SCRATCH_ID; else echo 'No scratch org needs to be deleted.'; fi - name: Create Scratch Org id: scratch-org-step run: |