mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-05 18:20:38 -08:00
* refactor: use TiddlyWiki/cerebrus@v5, and rename yml * continue-on-error: false * Update .github/workflows/pr-validation.yml to restrict contents permissions Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Saq Imtiaz <saq.imtiaz@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
55 lines
No EOL
1.7 KiB
YAML
55 lines
No EOL
1.7 KiB
YAML
name: Calculate PR build size
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, reopened, synchronize]
|
|
paths:
|
|
- 'boot/**'
|
|
- 'core/**'
|
|
- 'themes/tiddlywiki/snowwhite/**'
|
|
- 'themes/tiddlywiki/vanilla/**'
|
|
|
|
jobs:
|
|
calculate-build-size:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: read
|
|
contents: read
|
|
outputs:
|
|
pr_size: ${{ steps.get_sizes.outputs.pr_size }}
|
|
base_size: ${{ steps.get_sizes.outputs.base_size }}
|
|
steps:
|
|
- name: build-size-check
|
|
id: get_sizes
|
|
uses: TiddlyWiki/cerebrus@v5
|
|
with:
|
|
pr_number: ${{ github.event.pull_request.number }}
|
|
repo: ${{ github.repository }}
|
|
base_ref: ${{ github.event.pull_request.base.ref }}
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
mode: size:calc
|
|
|
|
dispatch-followup:
|
|
needs: calculate-build-size
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: write # Required to dispatch another workflow
|
|
pull-requests: write
|
|
contents: read
|
|
steps:
|
|
- name: Trigger follow-up workflow
|
|
uses: actions/github-script@v6
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
workflow_id: 'pr-comment-build-size.yml',
|
|
ref: 'master',
|
|
inputs: {
|
|
pr_number: '${{ github.event.pull_request.number }}',
|
|
base_ref: '${{ github.event.pull_request.base.ref }}',
|
|
pr_size: '${{ needs.calculate-build-size.outputs.pr_size }}',
|
|
base_size: '${{ needs.calculate-build-size.outputs.base_size }}'
|
|
}
|
|
}); |