mirror of
https://github.com/alexhopeoconnor/default.git
synced 2026-10-04 02:58:10 +10:00
Add edits check (#862)
This commit is contained in:
@@ -71,6 +71,20 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
edits:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check if PR is editable
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies if needed
|
||||
run: make init
|
||||
|
||||
- name: Run the check
|
||||
run: python3 -m scripts.check.edits
|
||||
|
||||
|
||||
hassfest:
|
||||
runs-on: ubuntu-latest
|
||||
name: "Check hassfest"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import asyncio
|
||||
|
||||
from scripts.helpers.event import get_event
|
||||
|
||||
|
||||
async def check():
|
||||
event = get_event()
|
||||
pull_request = event["pull_request"]
|
||||
if not pull_request["maintainer_can_modify"]:
|
||||
if pull_request["head"]["repo"]["full_name"] != "hacs/default":
|
||||
exit("::error::The PR is not editable by HACS maintainers")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.get_event_loop().run_until_complete(check())
|
||||
Reference in New Issue
Block a user