From 19dc80206000a931d986bdebc15a3991fe466362 Mon Sep 17 00:00:00 2001 From: Thang Bui Quang <89576896+thangbuiq@users.noreply.github.com> Date: Wed, 14 Feb 2024 04:24:35 +0000 Subject: [PATCH] feat: add time comment --- .github/workflows/pages.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 9d7316c..1dc4317 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -26,10 +26,14 @@ jobs: node-version: '18' - name: Install Dependencies - run: yarn install --frozen-lockfile + run: | + echo "before_time=$(date +%s)" >> $GITHUB_ENV + yarn install --frozen-lockfile - name: Build Website - run: yarn build + run: | + yarn build + echo "after_time=$(date +%s)" >> $GITHUB_ENV - name: Verify Build Output run: | @@ -50,12 +54,13 @@ jobs: if: github.event_name == 'pull_request' uses: actions/github-script@v7 with: + github-token: ${{ secrets.TOKEN_GITHUB }} script: | github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Test server functionality passed ✅' + body: 'Test server functionality passed ✅ with total CI time: ' + (process.env.after_time - process.env.before_time) + ' seconds' }); deploy-docusaurus: