Skip to content

Commit

Permalink
(#1) Attempting to fix an issue where commitlint couldn't validate th…
Browse files Browse the repository at this point in the history
…e commit messages because the PR branch was checked out as a detached head.

The error we received is below:

  error running commitlint
  fatal: ambiguous argument '46bb5821095a7e8e1ffd48f4697eec3c593c9b24^1..46bb582': unknown revision or path not in the working tree.

This was solved using a solution reported here: actions/checkout#124 (comment)
  • Loading branch information
danrivett committed Feb 23, 2020
1 parent cc25f8c commit 8ac9e0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v2
# We don't just checkout the last commit, but all commits
# This is so the commitlint GitHub Action below can lint commit messages
with:
# Checkout the PR branch to avoid detached heads as seems to break the commitlint action
# See: https://github.com/actions/checkout/issues/124#issuecomment-586664611
ref: ${{ github.event.pull_request.head.ref }}
# We don't just checkout the last commit, but all commits
# This is so the commitlint GitHub Action below can lint commit messages
fetch-depth: 0

- name: Set up Node.js
Expand Down

0 comments on commit 8ac9e0b

Please sign in to comment.