Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal committed Nov 3, 2024
1 parent b9fd13a commit ae43f06
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/dist-files-size-diff-comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dist Files Size Diff (Comment)

on:
workflow_run:
workflows: ["Dist Files Size Diff"]
types:
- completed

jobs:
dist-files-size-diff:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist-size-${{ github.event.number }}

- name: Comment on the pull request (if success)
if: ${{ always() && steps.diff.conclusion == 'success' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
path: ./dist-size.md
27 changes: 9 additions & 18 deletions .github/workflows/dist-files-size-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,20 @@ name: Dist Files Size Diff

on:
pull_request:
types: [opened, synchronize]
paths:
- 'src/*/assets/dist/**'
- 'src/*/src/Bridge/*/assets/dist/**'

jobs:
dist-files-size-diff:
runs-on: ubuntu-latest
permissions:
pull-requests: write # for marocchino/sticky-pull-request-comment@v2
steps:
- name: Configure git
run: |
git config --global user.email ""
git config --global user.name "github-action[bot]"
- uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
⏳ The dist files size difference is being calculated...
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
Expand Down Expand Up @@ -59,19 +53,16 @@ jobs:
with:
result-encoding: string
script: |
import * as fs from 'fs'
const { main } = await import('${{ github.workspace }}/.github/generate-dist-files-size-diff.mjs')
return await main()
const diff = await main()
console.log(diff);
- name: Comment on the pull request (if any failure)
if: ${{ failure() }}
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
❌ The dist files size difference could not be calculated. Please check the logs for more details.
fs.writeFileSync(process.env.GITHUB_WORKSPACE + '/dist-size.md', diff)
- name: Comment on the pull request (if success)
if: ${{ always() && steps.diff.conclusion == 'success' }}
uses: marocchino/sticky-pull-request-comment@v2
- name: Upload the diff
uses: actions/upload-artifact@v4
with:
message: ${{ steps.diff.outputs.result }}
name: dist-size-${{ github.event.number }}
path: ./dist-size.md

0 comments on commit ae43f06

Please sign in to comment.