mirror of
https://github.com/jlengrand/coffeechat.git
synced 2026-03-10 08:11:20 +00:00
31 lines
1.2 KiB
YAML
31 lines
1.2 KiB
YAML
name: Prevent README commits
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'README.md'
|
|
|
|
jobs:
|
|
check-for-readme-commit:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.actor != 'actions-user' }}
|
|
steps:
|
|
|
|
- name: Fail this PR
|
|
uses: actions/github-script@v7.0.1
|
|
if: ${{ github.event.head_commit.committer.username != 'actions-user' }}
|
|
with:
|
|
script: |
|
|
core.setFailed('Do not make changes in README.md directly. Update people.json: more information in CONTRIBUTING.md.')
|
|
|
|
- name: Add comment for the user
|
|
if: always()
|
|
uses: actions/github-script@v7.0.1
|
|
with:
|
|
script: |
|
|
github.rest.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: 'Do not make changes in README.md directly. Update [people.json](https://github.com/fharper/coffeechat/blob/main/people.json): more information in [CONTRIBUTING.md](https://github.com/fharper/coffeechat/blob/main/CONTRIBUTING.md).'
|
|
})
|