From 84513fa939c1922033d4dfad40abc71a8d7e7492 Mon Sep 17 00:00:00 2001 From: Devon Powell Date: Wed, 27 Nov 2024 13:05:08 -0500 Subject: [PATCH] Test --- .github/workflows/ci.yml | 13 +++++++------ src/report.js | 13 +++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad6b951..fee6fdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: run: npm run build - name: Handle changes (pull request) uses: Brightspace/third-party-actions@peter-evans/create-pull-request - if: github.triggering_actor != 'd2l-github-action-tokens[bot]' + if: github.triggering_actor != 'devpow112' id: changes-pr with: commit-message: Update Build @@ -73,7 +73,7 @@ jobs: add-paths: dist/* - name: Leave comment if: > - github.triggering_actor != 'd2l-github-action-tokens[bot]' && + github.triggering_actor != 'devpow112' && steps.changes-pr.outputs.pull-request-operation == 'created' uses: BrightspaceUI/actions/comment-on-pr@main with: @@ -84,7 +84,7 @@ jobs: post-mode: hide-previous - name: Report status if: > - github.triggering_actor != 'd2l-github-action-tokens[bot]' && + github.triggering_actor != 'devpow112' && ( steps.changes-pr.outputs.pull-request-operation == 'created' || steps.changes-pr.outputs.pull-request-operation == 'updated' @@ -94,10 +94,10 @@ jobs: script: core.setFailed('Build changes detected') - name: Handle changes (push) id: changes-push - if: github.triggering_actor == 'd2l-github-action-tokens[bot]' + if: github.triggering_actor == 'devpow112' run: | set +e - git diff --exit-code 'dist/*' + git diff --exit-code --name-only 'dist/*' RESULT="$?" set -e if [[ "$RESULT" -eq 0 ]]; then @@ -108,9 +108,10 @@ jobs: echo "exist=true" >> $GITHUB_OUTPUT git config user.name github-actions[bot] git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git fetch -n origin $GITHUB_HEAD_REF git add 'dist/*' git commit -m 'Update Build' - git push -f "https://${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY" $GITHUB_REF + git push -f "https://$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" "$GITHUB_HEAD_REF" env: GITHUB_TOKEN: ${{secrets.PR_MANAGE_TOKEN}} - name: Approve diff --git a/src/report.js b/src/report.js index f887c3d..24e0d5e 100644 --- a/src/report.js +++ b/src/report.js @@ -94,11 +94,8 @@ const makeDetailRecord = (detail) => { location, retries, timeout, - duration: { - total, - final - }, status, + duration: { total, final }, browser, type, experience, @@ -187,7 +184,7 @@ const makeDetailWriteRequests = (report) => { return writeRequests; }; -const assumeRole = async(region, credentials, arn, sessionName, duration, tags) => { +const assumeRole = async (region, credentials, arn, sessionName, duration, tags) => { const client = new STSClient({ region, credentials }); const command = new AssumeRoleCommand({ RoleArn: arn, @@ -205,7 +202,7 @@ const assumeRole = async(region, credentials, arn, sessionName, duration, tags) }; }; -const writeTimestream = async(region, credentials, requests) => { +const writeTimestream = async (region, credentials, requests) => { const client = new TimestreamWriteClient({ credentials, region }); for (const request of requests) { @@ -215,7 +212,7 @@ const writeTimestream = async(region, credentials, requests) => { } }; -const finalize = async(logger, context, inputs) => { +const finalize = async (logger, context, inputs) => { logger.startGroup('Finalize test report'); const { reportPath, injectGitHubContext, lmsBuildNumber, lmsInstanceUrl, debug } = inputs; @@ -273,7 +270,7 @@ const finalize = async(logger, context, inputs) => { return report; }; -const submit = async(logger, context, inputs, report) => { +const submit = async (logger, context, inputs, report) => { logger.startGroup('Submit report'); logger.info('Generate summary write request');