From 8a7ff9d2aaccacb265a48cf769da8dcf111d1d6e Mon Sep 17 00:00:00 2001 From: Morrison Cole Date: Tue, 26 Nov 2019 12:19:13 +0900 Subject: [PATCH] documentation: usage example --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 36463cf1..50166845 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,29 @@ A GitHub Action to ensure that your PR title matches a given regex. +## Usage + +Create a workflow definition at `.github/workflows/.yml` with something like the following contents: + +```yaml +name: PR Lint + +on: + pull_request: + types: [opened, edited, reopened] + +jobs: + pr-lint: + runs-on: ubuntu-latest + steps: + - uses: morrisoncole/pr-lint-action@v1.0.0 + with: + title-regex: "#EX-[0-9]+" + on-failed-regex-comment: "This is just an example. Failed regex: `%regex%`!" + repo-token: "${{ secrets.GITHUB_TOKEN }}" + +``` + ## Related Reading * [GitHub Action Metadata Syntax](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions)