From 4955397fc3291d72cc3e7640dcd3dac831c99d4e Mon Sep 17 00:00:00 2001 From: dugg molidor Date: Tue, 8 Nov 2022 10:15:28 -0800 Subject: [PATCH] feat(ci): Migrate VRT CircleCI jobs to GH Actions (#5092) * create initial VRT GitHub Action workflow config * remove on-pr-labeled workflow * migrate vrt-prepare job * add applitool batch data call * add temp applitools files for testing * add pr-checks node script and ci steps from spike * unwind dev state test files * add baselineBranchName to applitools configs * break up VRT workflow into jobs * add vrt-legacy and vrt-mobile jobs * add Applitools env to context * remove VRT CircleCI workflows from config * add branchName to applitools configs * add parentBranchName to applitools configs * update release notes --- .circleci/config.yml | 175 --------------------------- .github/workflows/on-pr-labeled.yml | 26 ---- .github/workflows/vrt.yml | 179 ++++++++++++++++++++++++++++ RELEASENOTES.general.md | 1 + RELEASENOTES.md | 1 + applitools.config.js | 35 +++--- applitools.legacy.config.js | 36 +++--- applitools.mobile.config.js | 40 ++++--- scripts/ci/pr-checks.js | 66 ++++++++++ 9 files changed, 307 insertions(+), 252 deletions(-) delete mode 100644 .github/workflows/on-pr-labeled.yml create mode 100644 .github/workflows/vrt.yml create mode 100644 scripts/ci/pr-checks.js diff --git a/.circleci/config.yml b/.circleci/config.yml index aeb81ccd44..5078555e89 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -522,67 +522,6 @@ jobs: gh api ${STATUS_URL} -f state=success -f environment_url=${SITE_URL} -H "Accept: application/vnd.github.ant-man-preview+json" done - vrt-init: - executor: slds-executor - resource_class: small - - steps: - - checkout - - run: mkdir -p workspace - - gh/install - - get-pr-number - - - persist_to_workspace: - root: workspace - paths: - - gh-pr-num.txt - - vrt-desktop: - executor: slds-executor - resource_class: large - - steps: - - prepare-vrt - - # run Applitools tests! - - run: - name: Applitools - command: 'VRT_MODE=<< pipeline.parameters.vrt_mode >> npx eyes-storybook' # -u https://${REVIEW_APP_NAME}.herokuapp.com - no_output_timeout: 20m - - vrt-mobile: - executor: slds-executor - resource_class: large - - steps: - - prepare-vrt - - # run Applitools tests! - - run: - name: Applitools (mobile) - command: 'STORYBOOK_STORIES_TYPE=mobile npx eyes-storybook --conf applitools.mobile.config.js' # -u https://${REVIEW_APP_NAME}.herokuapp.com - no_output_timeout: 20m - - vrt-legacy: - executor: slds-executor - resource_class: large - - steps: - - prepare-vrt - - # run Applitools tests! - - run: - name: Applitools (legacy) - command: 'STORYBOOK_SLDS_VERSION=legacy npx eyes-storybook --conf applitools.legacy.config.js' # -u https://${REVIEW_APP_NAME}.herokuapp.com - no_output_timeout: 20m - - vrt-close: - executor: slds-executor - resource_class: small - - steps: - - vrt-close-batch - workflows: version: 2 CI: @@ -635,117 +574,3 @@ workflows: only: /^v\d+\.\d+\.\d+.*/ branches: ignore: /.*/ - - CI_scheduled: - triggers: - - schedule: - cron: "0 0 * * *" - filters: - branches: - only: - # filtering only for this integration branch, for now - - 236-spring-22 - jobs: - - vrt-init: - context: ux-eng-keys - filters: - tags: - only: /.*/ - - vrt-desktop: - context: ux-eng-keys - # do not run for main version branches - filters: - branches: - ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/ - requires: - - vrt-init - - vrt-mobile: - context: ux-eng-keys - # do not run for main version branches - filters: - branches: - ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/ - requires: - - vrt-init - - vrt-legacy: - context: ux-eng-keys - # do not run for main version branches - filters: - branches: - ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/ - requires: - - vrt-init - - vrt-close: - context: ux-eng-keys - requires: - - vrt-desktop - - vrt-mobile - - vrt-legacy - - # This runs when a PR is labeled: vrt:chrome-ready - CI_VRT_chrome: - when: - and: - - << pipeline.parameters.run_labeled_workflow >> - - equal: [ chrome, << pipeline.parameters.vrt_mode >>] - jobs: - - vrt-init: - context: ux-eng-keys - filters: - tags: - only: /.*/ - - vrt-desktop: - context: ux-eng-keys - # do not run for main version branches - filters: - branches: - ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/ - requires: - - vrt-init - - vrt-close: - context: ux-eng-keys - requires: - - vrt-desktop - - # This runs when a PR is labeled: vrt:full-ready - CI_VRT_full: - when: - and: - - << pipeline.parameters.run_labeled_workflow >> - - equal: [ full, << pipeline.parameters.vrt_mode >>] - jobs: - - vrt-init: - context: ux-eng-keys - filters: - tags: - only: /.*/ - - vrt-desktop: - context: ux-eng-keys - # do not run for main version branches - filters: - branches: - ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/ - requires: - - vrt-init - - vrt-mobile: - context: ux-eng-keys - # do not run for main version branches - filters: - branches: - ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/ - requires: - - vrt-init - - vrt-legacy: - context: ux-eng-keys - # do not run for main version branches - filters: - branches: - ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/ - requires: - - vrt-init - - vrt-close: - context: ux-eng-keys - requires: - - vrt-desktop - - vrt-mobile - - vrt-legacy diff --git a/.github/workflows/on-pr-labeled.yml b/.github/workflows/on-pr-labeled.yml deleted file mode 100644 index 3dd1e31e07..0000000000 --- a/.github/workflows/on-pr-labeled.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Trigger CircleCI from Label - -on: - pull_request: - types: [labeled] - -jobs: - execute: - if: ${{ github.event.label.name == 'vrt:chrome-ready' || github.event.label.name == 'vrt:full-ready'}} - runs-on: ubuntu-latest - steps: - - name: Set VRT Mode parameter - run: | - echo "VRT_MODE=$(echo ${{ github.event.label.name }} | sed 's/\(.*\):\(.*\)-\(.*\)/\2/')" >> $GITHUB_ENV - - name: Print context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: | - echo "$GITHUB_CONTEXT" - - name: Trigger CircleCI VRT workflow. - uses: promiseofcake/circleci-trigger-action@v1 - with: - user-token: ${{ secrets.CIRCLECI_TOKEN }} - project-slug: salesforce-ux/design-system-internal - branch: ${{ github.head_ref }} - payload: '{"run_labeled_workflow": true, "vrt_mode": "${{ env.VRT_MODE }}","triggering_label": "${{ github.event.label.name }}"}' diff --git a/.github/workflows/vrt.yml b/.github/workflows/vrt.yml new file mode 100644 index 0000000000..6bc9d686d0 --- /dev/null +++ b/.github/workflows/vrt.yml @@ -0,0 +1,179 @@ +name: Trigger VRT from Label + +on: + pull_request: + types: [labeled] + +env: + APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} + APPLITOOLS_BATCH_ID: ${{ github.sha }} + APPLITOOLS_BATCH_NAME: PR ${{ github.event.pull_request.number }} (${{ github.actor }}) + APPLITOOLS_DONT_CLOSE_BATCHES: true + APPLITOOLS_BATCH_NOTIFY: true + APPLITOOLS_REPO_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + REVIEW_APP_NAME: slds-storybook-pr-${{ github.event.pull_request.number }} + +jobs: + vrt-init: + if: ${{ github.event.label.name == 'vrt:chrome-ready' || github.event.label.name == 'vrt:full-ready'}} + runs-on: ubuntu-latest + + steps: + - name: Set VRT Mode parameter + run: | + echo "VRT_MODE=$(echo ${{ github.event.label.name }} | sed 's/\(.*\):\(.*\)-\(.*\)/\2/')" >> $GITHUB_ENV + + - name: Print context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" + - run: printenv | sort + + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + cache: 'npm' + + vrt-desktop: + needs: vrt-init + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + cache: 'npm' + + - name: Add Applitools eyes-storybook module + run: npm i @applitools/eyes-storybook@latest --save-dev --package-lock-only + - run: npm ci + - name: Prepare Storybook + run: npm run storybook:prepare + # Hack to create TTY for GitHub Actions runners + # https://github.com/gfx/example-github-actions-with-tty#hack-to-create-tty-for-github-actions-runners + shell: 'script -q -e -c "bash {0}"' + + - run: printenv | sort + + - name: Set VRT Mode parameter + run: | + echo "VRT_MODE=$(echo ${{ github.event.label.name }} | sed 's/\(.*\):\(.*\)-\(.*\)/\2/')" >> $GITHUB_ENV + + - name: Applitools + run: 'VRT_MODE=${{ env.VRT_MODE }} npx eyes-storybook' + timeout-minutes: 20 + + vrt-legacy: + if: ${{ github.event.label.name == 'vrt:full-ready'}} + needs: vrt-init + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + cache: 'npm' + + - name: Add Applitools eyes-storybook module + run: npm i @applitools/eyes-storybook@latest --save-dev --package-lock-only + - run: npm ci + + - name: Prepare Storybook + run: npm run storybook:prepare + # Hack to create TTY for GitHub Actions runners + # https://github.com/gfx/example-github-actions-with-tty#hack-to-create-tty-for-github-actions-runners + shell: 'script -q -e -c "bash {0}"' + + - run: printenv | sort + + - name: Set VRT Mode parameter + run: | + echo "VRT_MODE=$(echo ${{ github.event.label.name }} | sed 's/\(.*\):\(.*\)-\(.*\)/\2/')" >> $GITHUB_ENV + + - name: Applitools + run: 'STORYBOOK_SLDS_VERSION=legacy npx eyes-storybook --conf applitools.legacy.config.js' # -u https://${REVIEW_APP_NAME}.herokuapp.com + timeout-minutes: 20 + + vrt-mobile: + if: ${{ github.event.label.name == 'vrt:full-ready'}} + needs: vrt-init + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + cache: 'npm' + + - name: Add Applitools eyes-storybook module + run: npm i @applitools/eyes-storybook@latest --save-dev --package-lock-only + - run: npm ci + + - name: Prepare Storybook + run: npm run storybook:prepare + # Hack to create TTY for GitHub Actions runners + # https://github.com/gfx/example-github-actions-with-tty#hack-to-create-tty-for-github-actions-runners + shell: 'script -q -e -c "bash {0}"' + + - run: printenv | sort + + - name: Set VRT Mode parameter + run: | + echo "VRT_MODE=$(echo ${{ github.event.label.name }} | sed 's/\(.*\):\(.*\)-\(.*\)/\2/')" >> $GITHUB_ENV + + - name: Applitools + run: 'STORYBOOK_SLDS_VERSION=mobile npx eyes-storybook --conf applitools.mobile.config.js' # -u https://${REVIEW_APP_NAME}.herokuapp.com + timeout-minutes: 20 + + vrt-wrap: + needs: [vrt-desktop, vrt-legacy, vrt-mobile] + if: always() && !cancelled() && !contains(needs.*.result, 'failure') + runs-on: ubuntu-latest + env: + APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} + + steps: + - name: Get Applitools Latest Batch + id: applitools_batch + run: echo "batches=$(curl -H "X-Eyes-Api-Key:${{ secrets.APPLITOOLS_API_KEY }}" -X GET "https://salesforceuxeyesapi.applitools.com/api/v1/batches" | jq -rc '.batches[0]')" >> $GITHUB_OUTPUT + + - name: Show Applitools Latest Batch + # single quotes are needed around the JSON string here to preserve the double quotes around the props and values + run: echo '${{ steps.applitools_batch.outputs.batches }}' + + - uses: tibdex/github-app-token@v1 + id: get_installation_token + with: + app_id: 244972 + private_key: ${{ secrets.DSE_CI_APP_KEY }} + + - name: Dump GitHub context event + id: github_context_event_step + run: echo '${{ toJSON(github.event) }}' + + - name: Show GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v3 + with: + cache: 'npm' + + - name: Install OctoKit + run: npm i @octokit/core @octokit/auth-app @octokit/rest + + - name: Do the check + env: + THE_SHA: ${{ github.event.pull_request.head.sha }} + OCTOKIT_PAT: ${{ steps.get_installation_token.outputs.token }} + GH_APP_ID: 244972 + GH_APP_INSTALLATION_ID: 29956208 + GH_APP_PRIVATE_KEY: ${{ secrets.DSE_CI_APP_KEY }} + GH_APP_CLIENT_ID: Iv1.6aaf118377862b49 + GH_APP_CLIENT_SECRET: ${{ secrets.DSE_CI_CLIENT_SECRET }} + # single quotes are needed around the JSON string here so that is can be parsed by the node script + run: batchesData='${{ steps.applitools_batch.outputs.batches }}' node scripts/ci/pr-checks \ No newline at end of file diff --git a/RELEASENOTES.general.md b/RELEASENOTES.general.md index 520c92f3cd..62fa64231a 100644 --- a/RELEASENOTES.general.md +++ b/RELEASENOTES.general.md @@ -10,6 +10,7 @@ - `@salesforce-ux/sds-styling-hooks` with version `1.1.0-alpha.2` - Updated `gulp` file to include SLDS global hooks generation as part of build and dist jobs - Updated design tokens in every component and utility with SLDS global styling hooks (except Brand-related tokens) +- Updated CI workflows migrating from CircleCI to GitHub Actions - Updated icons to `v10.5.3` - Standard Set: - Added `asset_hierarchy` diff --git a/RELEASENOTES.md b/RELEASENOTES.md index cb906fd54d..c4a4bb2a5e 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -10,6 +10,7 @@ - `@salesforce-ux/sds-styling-hooks` with version `1.1.0-alpha.2` - Updated `gulp` file to include SLDS global hooks generation as part of build and dist jobs - Updated design tokens in every component and utility with SLDS global styling hooks (except Brand-related tokens) +- Updated CI workflows migrating from CircleCI to GitHub Actions - Updated icons to `v10.5.3` - Standard Set: - Added `asset_hierarchy` diff --git a/applitools.config.js b/applitools.config.js index b570fe716c..f9cdac84d3 100644 --- a/applitools.config.js +++ b/applitools.config.js @@ -30,32 +30,37 @@ const browsersToTest = () => { module.exports = { apiKey: process.env.APPLITOOLS_API_KEY, - appName: 'SLDS', - matchLevel: 'Strict', + appName: "SLDS", + matchLevel: "Strict", ignoreDisplacements: true, - properties: [{ name: 'Group', value: 'desktop' }], - batchName: process.env.CI ? undefined : '', + properties: [{ name: "Group", value: "desktop" }], + batchName: process.env.CI ? undefined : "", branchName: process.env.CI - ? undefined + ? `${process.env.GITHUB_REPOSITORY}/${process.env.GITHUB_HEAD_REF}` : `localRun/${process.env.LOGNAME}/${currentBranch}`, - parentBranchName: process.env.CI ? undefined : `localRun/${currentBranch}`, + parentBranchName: process.env.CI + ? `${process.env.GITHUB_REPOSITORY}/${process.env.APPLITOOLS_REPO_DEFAULT_BRANCH}` + : `localRun/${currentBranch}`, + baselineBranchName: process.env.CI + ? `${process.env.GITHUB_REPOSITORY}/${process.env.GITHUB_BASE_REF}` + : undefined, showLogs: process.env.CI || false, showStorybookOutput: process.env.CI || false, // saveDebugData: false, exitcode: false, testConcurrency: 100, - serverUrl: 'https://salesforceuxeyesapi.applitools.com', - testBlueprintPattern: '.*', - testNamePattern: '^(?:.+|) ?Sink', - include: function({ kind, name }) { + serverUrl: "https://salesforceuxeyesapi.applitools.com", + testBlueprintPattern: ".*", + testNamePattern: "^(?:.+|) ?Sink", + include: function ({ kind, name }) { return ( - new RegExp(this.testBlueprintPattern, 'gi').test(kind) && - new RegExp(this.testNamePattern, 'gi').test(name) + new RegExp(this.testBlueprintPattern, "gi").test(kind) && + new RegExp(this.testNamePattern, "gi").test(name) ); }, - puppeteerOptions: process.env.CIRCLECI - ? { executablePath: '/usr/bin/google-chrome' } + puppeteerOptions: process.env.CI + ? { executablePath: "/usr/bin/google-chrome" } : undefined, waitBeforeScreenshot: 1000, - browser: browsersToTest() + browser: browsersToTest(), }; diff --git a/applitools.legacy.config.js b/applitools.legacy.config.js index 9f0019447b..1234d3c06d 100644 --- a/applitools.legacy.config.js +++ b/applitools.legacy.config.js @@ -5,39 +5,41 @@ const currentBranch = branch.sync(); module.exports = { apiKey: process.env.APPLITOOLS_API_KEY, - appName: 'SLDS', - matchLevel: 'Strict', + appName: "SLDS", + matchLevel: "Strict", ignoreDisplacements: true, - properties: [{ name: 'Group', value: 'legacy' }], - batchName: process.env.CI ? undefined : '', + properties: [{ name: "Group", value: "legacy" }], + batchName: process.env.CI ? undefined : "", branchName: process.env.CI - ? undefined + ? `${process.env.GITHUB_REPOSITORY}/${process.env.GITHUB_HEAD_REF}` : `localRun/${process.env.LOGNAME}/${currentBranch}`, - parentBranchName: process.env.CI ? undefined : `localRun/${currentBranch}`, + parentBranchName: process.env.CI + ? `${process.env.GITHUB_REPOSITORY}/${process.env.APPLITOOLS_REPO_DEFAULT_BRANCH}` + : `localRun/${currentBranch}`, showLogs: process.env.CI || false, showStorybookOutput: process.env.CI || false, // saveDebugData: false, exitcode: false, testConcurrency: 100, - serverUrl: 'https://salesforceuxeyesapi.applitools.com', - testBlueprintPattern: '.*', - testNamePattern: '^(?:.+|) ?Sink', - include: function({ name, kind }) { + serverUrl: "https://salesforceuxeyesapi.applitools.com", + testBlueprintPattern: ".*", + testNamePattern: "^(?:.+|) ?Sink", + include: function ({ name, kind }) { return ( - new RegExp(this.testBlueprintPattern, 'gi').test(kind) && - new RegExp(this.testNamePattern, 'gi').test(name) + new RegExp(this.testBlueprintPattern, "gi").test(kind) && + new RegExp(this.testNamePattern, "gi").test(name) ); }, - puppeteerOptions: process.env.CIRCLECI - ? { executablePath: '/usr/bin/google-chrome' } + puppeteerOptions: process.env.CI + ? { executablePath: "/usr/bin/google-chrome" } : undefined, waitBeforeScreenshot: 1000, fakeIE: true, visualGridOptions: { - ieV2: true + ieV2: true, }, browser: [ // { width: resolution.width, height: resolution.height, name: 'edgelegacy' }, - { width: resolution.width, height: resolution.height, name: 'ie11' } - ] + { width: resolution.width, height: resolution.height, name: "ie11" }, + ], }; diff --git a/applitools.mobile.config.js b/applitools.mobile.config.js index 9227082b36..1873e3cc3e 100644 --- a/applitools.mobile.config.js +++ b/applitools.mobile.config.js @@ -4,39 +4,41 @@ const currentBranch = branch.sync(); module.exports = { apiKey: process.env.APPLITOOLS_API_KEY, - appName: 'SLDS', - matchLevel: 'Strict', + appName: "SLDS", + matchLevel: "Strict", ignoreDisplacements: true, - properties: [{ name: 'Group', value: 'mobile' }], - batchName: process.env.CI ? undefined : '', + properties: [{ name: "Group", value: "mobile" }], + batchName: process.env.CI ? undefined : "", branchName: process.env.CI - ? undefined + ? `${process.env.GITHUB_REPOSITORY}/${process.env.GITHUB_HEAD_REF}` : `localRun/${process.env.LOGNAME}/${currentBranch}`, - parentBranchName: process.env.CI ? undefined : `localRun/${currentBranch}`, + parentBranchName: process.env.CI + ? `${process.env.GITHUB_REPOSITORY}/${process.env.APPLITOOLS_REPO_DEFAULT_BRANCH}` + : `localRun/${currentBranch}`, showLogs: process.env.CI || false, showStorybookOutput: process.env.CI || false, // saveDebugData: false, exitcode: false, testConcurrency: 100, - serverUrl: 'https://salesforceuxeyesapi.applitools.com', - testBlueprintPattern: '.*', - testNamePattern: '^(?:.+|) ?Sink', - include: function({ name, kind }) { + serverUrl: "https://salesforceuxeyesapi.applitools.com", + testBlueprintPattern: ".*", + testNamePattern: "^(?:.+|) ?Sink", + include: function ({ name, kind }) { return ( - new RegExp(this.testBlueprintPattern, 'gi').test(kind) && - new RegExp(this.testNamePattern, 'gi').test(name) + new RegExp(this.testBlueprintPattern, "gi").test(kind) && + new RegExp(this.testNamePattern, "gi").test(name) ); }, - puppeteerOptions: process.env.CIRCLECI - ? { executablePath: '/usr/bin/google-chrome' } + puppeteerOptions: process.env.CI + ? { executablePath: "/usr/bin/google-chrome" } : undefined, waitBeforeScreenshot: 1000, browser: [ { iosDeviceInfo: { - deviceName: 'iPhone XR', - screenOrientation: 'portrait' - } - } - ] + deviceName: "iPhone XR", + screenOrientation: "portrait", + }, + }, + ], }; diff --git a/scripts/ci/pr-checks.js b/scripts/ci/pr-checks.js new file mode 100644 index 0000000000..9c8b8e5496 --- /dev/null +++ b/scripts/ci/pr-checks.js @@ -0,0 +1,66 @@ +// https://docs.github.com/en/rest/reference/commits#create-a-commit-status +const { Octokit } = require("@octokit/rest"); +const { createAppAuth } = require("@octokit/auth-app"); + +const batchesDataArg = process.env.batchesData || `{ "dev": null }`; +console.log(batchesDataArg); +const batchesData = JSON.parse(batchesDataArg); +console.log(batchesData); + +const { owner, repo, sha } = { + owner: "salesforce-ux", + repo: "design-system-internal", + sha: process.env.THE_SHA, +}; + +const appOctokit = new Octokit({ + authStrategy: createAppAuth, + auth: { + appId: process.env.GH_APP_ID, + privateKey: process.env.GH_APP_PRIVATE_KEY, + clientId: process.env.GH_APP_CLIENT_ID, + clientSecret: process.env.GH_APP_CLIENT_SECRET, + installationId: process.env.GH_APP_INSTALLATION_ID, + }, +}); + +// AFAIK this endpoint doesn't work with GitHub Apps +// (async () => { + +// // Send requests as GitHub App +// const { slug, data: root } = await appOctokit.request("GET /user"); +// console.log("authenticated as %s", slug); + +// })(); + +(async () => { + + // Send requests as GitHub App + const pullsResponse = await appOctokit.request( + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", { + owner, + repo, + commit_sha: sha, + } + ); + console.log("pulls", pullsResponse); + +})(); + +(async () => { + const { id, failed, unresolved, new: vrtNew, passed } = batchesData; + const checksPostResponse = await appOctokit.request( + "POST /repos/{owner}/{repo}/statuses/{sha}", + { + owner, + repo, + sha, + state: failed + unresolved + vrtNew === 0 ? "success" : "failure", + target_url: `https://salesforceuxeyes.applitools.com/app/test-results/${id}`, + description: `${failed} Failed / ${unresolved} Unresolved / ${vrtNew} New / ${passed} Passed`, + context: "Applitools (VRT)", + } + ); + console.log("pulls", checksPostResponse); + +})();