From 6ac74e217ef78eb94c600240bc26294d217d592d Mon Sep 17 00:00:00 2001 From: "Runzhou Li (Leo)" Date: Wed, 7 Jul 2021 13:13:45 -0400 Subject: [PATCH 1/2] devops - dogfood checkout fetch-depth 0 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3d6afe7..dd6dc7e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - fetch-depth: 2 + fetch-depth: 0 - name: Set Node.js version uses: actions/setup-node@v2 From aeba49694c43282318d2e97643b0faad9d1e8612 Mon Sep 17 00:00:00 2001 From: "Runzhou Li (Leo)" Date: Wed, 7 Jul 2021 13:16:32 -0400 Subject: [PATCH 2/2] README - update CI integration example --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a10d523..a4bc41b 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,21 @@ and the exit code: 1 ``` -To use it in an automated/CI environment such as GitHub Actions, check out the `dogfood` job in [this workflow](.github/workflows/main.yml), essentially by pinning down the `--base` and `--head` git refs (in this case, through the given `${{ github }}` context): +To use it in an automated/CI environment, make sure to pin down the `--base` and `--head` git refs. A generic example in GitHub Actions (in this case, through the given `${{ github }}` context): -``` -commit-watch -b ${{ github.event.pull_request.base.sha }} -h ${{ github.event.pull_request.head.sha }} -v +```yaml +jobs: + commit-watch: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v2 + with: + node-version: 14.x + + - run: npx @eqworks/commit-watch -b ${{ github.event.pull_request.base.sha }} -h ${{ github.event.pull_request.head.sha }} -v ```