[WIP] Test PR stats with Babel private fields #75
This file contains 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 characters
name: Stats comment | |
on: | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
pull-requests: write | |
jobs: | |
generate-stats: | |
name: Generate stats | |
runs-on: ubuntu-latest | |
# Skip when token write permissions are unavailable on forks | |
if: ${{ !github.event.pull_request.head.repo.fork }} | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Restore dependencies | |
uses: ./.github/workflows/actions/install-node | |
- name: Build | |
uses: ./.github/workflows/actions/build | |
- name: Add comment to PR | |
uses: actions/[email protected] | |
env: | |
WORKSPACE_DIR: ${{ github.workspace }} | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const { commentStats } = await import('${{ github.workspace }}/.github/workflows/scripts/comments.mjs') | |
// PR information | |
const issueNumber = ${{ github.event.pull_request.number }} | |
const commit = '${{ github.event.pull_request.head.sha }}' | |
const options = { | |
titleText: ':clipboard: Stats', | |
markerText: 'stats' | |
} | |
await commentStats({ github, context, commit }, issueNumber, options) |