Skip to content

Only lint JS files in the src directory #2

Only lint JS files in the src directory

Only lint JS files in the src directory #2

name: Test for block.json files.
on:
pull_request:
branches: [ trunk, develop ]
jobs:
block-file-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get all files
id: changed-block-json-files
uses: tj-actions/changed-files@v44
- name: Leave a comment and reject PR if block.json file is present
if: contains(steps.changed-block-json-files.outputs.all_changed_files, 'block.json')
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '> [!CAUTION]\n> This PR includes a `block.json` file. If you are adding a new block, please ensure this goes into [the WPCOM Special Projects Monorepo](https://github.com/a8cteam51/special-projects-blocks-monorepo) instead. You will find[ full documentation on the process here](https://github.com/a8cteam51/special-projects-blocks-monorepo/wiki). Please discuss with WPComSP Engineering Leads if you believe your block should be exempt from the monorepo.'
})
core.setFailed('This PR included a block.json file and so was rejected.')