Skip to content

Learning actions. Attempting to implement a size checker that limits … #1

Learning actions. Attempting to implement a size checker that limits …

Learning actions. Attempting to implement a size checker that limits … #1

Workflow file for this run

name: Enforce 100KB size limit
on:
pull_request
# Allows you to run this workflow manually from the Actions tab

Check failure on line 5 in .github/workflows/size_check.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/size_check.yml

Invalid workflow file

You have an error in your yaml syntax on line 5
workflow_dispatch:
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Check only files modified by this change to see if any exceed 100K
- name: Size check
run: |
changed=$(git diff --name-only -r $${{ GITHUB_HEAD_REF }} HEAD)
if [[ -z $changed ]]; then exit 0; fi
too_large=$(find $changed -size +100k)
if [[ -n $too_large ]]; then exit 1; else exit 0; fi