Skip to content

Commit a260c56

Browse files
authored
Print commit stats (microsoft#5596)
* Add printCommitStats * New doc category * Better name * Fix filename and run npm ci * Add dependencies * Better categorization * Fetch main * Diff from main * Use origin/main * Better output * Add disclaimer * Add a broader permissions.content: read
1 parent 5b04ab2 commit a260c56

File tree

4 files changed

+1633
-51
lines changed

4 files changed

+1633
-51
lines changed

.github/workflows/pull-request-validation.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ env:
2424
NODE_ENV: test # Add instrumentation code
2525
node-version: 18.20 # Need to bump jest@29 to resolve something in https://github.com/facebook/react-native/issues/35701
2626

27+
permissions:
28+
contents: read
29+
2730
jobs:
2831
build:
2932
name: Build
@@ -341,3 +344,26 @@ jobs:
341344
delete-merged: true
342345
name: test-snapshot-diff
343346
pattern: test-snapshot-diff-*
347+
348+
print-commit-stats:
349+
if: always()
350+
name: Print commit stats
351+
permissions:
352+
contents: read
353+
runs-on: ubuntu-latest
354+
355+
steps:
356+
- uses: actions/checkout@v4
357+
358+
- run: git fetch origin main
359+
360+
- name: Use Node.js ${{ env.node-version }}
361+
uses: actions/setup-node@v4
362+
with:
363+
node-version: ${{ env.node-version }}
364+
cache: npm
365+
366+
- run: npm clean-install
367+
368+
- name: Print commit stats
369+
run: node ./scripts/printCommitStats.mjs | tee --append $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)