Last active
June 16, 2023 06:11
-
-
Save bastionkid/3b41693456e908a04ae736690cbfb069 to your computer and use it in GitHub Desktop.
Revisions
-
bastionkid revised this gist
Jun 16, 2023 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,10 +24,12 @@ jobs: runs-on: ubuntu-latest steps: # Step 1 - uses: actions/download-artifact@v3 with: name: ${{ env.size_diff_report_file }} # Step 2 - name: Add PR Comment uses: actions/github-script@v6 with: -
bastionkid created this gist
Jun 16, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ name: Size Metrics ... # content is omitted as it's already shown earlier ... env: size_diff_report_file: apk_size_diff_report.html jobs: build: ... # content is omitted as it's already shown earlier ... size_diff_report: ... # content is omitted as it's already shown earlier ... pr_comment: needs: size_diff_report name: PR Comment (Size Report) runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v3 with: name: ${{ env.size_diff_report_file }} - name: Add PR Comment uses: actions/github-script@v6 with: script: | const fs = require('fs'); try { const filePath = 'apk_size_diff_report.html' const sizeReportContent = fs.readFileSync(filePath, 'utf8') const result = await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: sizeReportContent }) console.log(result) } catch (error) { console.error('Error reading file:', error); }