Skip to content

Commit

Permalink
Fill in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyhs committed Jun 26, 2023
1 parent 9cd66d8 commit 5e9e9bf
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,40 @@

# CodeMention

In-progress GitHub Action similar to https://github.com/sourcegraph/codenotify except that it will use GitHub's REST API to fetch the pull request diff instead of cloning the repo.
CodeMention is a GitHub Action that mentions users and teams who subscribe to certain file changes on pull requests.

This is similar to [Codenotify](https://github.com/sourcegraph/codenotify), but this retrieves the diff via GitHub's REST API instead of using [actions/checkout](https://github.com/actions/checkout) to clone the repo.

## Usage

To use this GitHub Action, add a `.github/codemention.yml` file to your repo that contains mentions/notifications rules.
An example looks like:
```yaml
rules:
- patterns: ['config/**']
mentions: ['sysadmin']
- patterns: ['db/migrate/**']
mentions: ['cto', 'dba']
- patterns: ['.github/**', 'spec/*.rb']
mentions: ['ci']
```
Add a `.github/workflows/codemention.yml` file to your repo with the following:
```yaml
name: codemention
on:
pull_request_target:
types: [opened, synchronize, ready_for_review]
jobs:
codemention:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: tobyhs/codemention@v1
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
```

0 comments on commit 5e9e9bf

Please sign in to comment.