-
Notifications
You must be signed in to change notification settings - Fork 6
30 lines (25 loc) · 1.25 KB
/
block-json-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Test for block.json files.
on:
pull_request:
branches: [ trunk, develop ]
jobs:
block-file-check:
runs-on: ubuntu-latest
timeout-minutes: 3
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 A8C 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 A8CSP 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.')