sindresorhus / awesome-lint

Linter for Awesome lists
MIT License
600 stars 56 forks source link

fix: If remote cannot be inferred, default to config `clone.defaultRemoteName`, then `origin` #173

Closed hyperupcall closed 11 months ago

hyperupcall commented 11 months ago

From this comment in the referrenced issue:

This broke linting because the code did not take into account that HEAD may not point to a branch - it could be in a detached state. And this commonly occurs in Github Actions when @actions/checkout is used to clone a repository.

If we are not currently in a branch, then we:

These fixes were tested in this PR (and this PR), which had CI config like:

jobs:
  awesome-lint:
    steps:
      - name: "checkout repo"
        uses: actions/checkout@v2.0.0
        with:
          fetch-depth: 0
      - run: |
          npm install --global 'https://github.com/fox-forks/awesome-lint.git#hyperupcall-detached-state-patch'
          awesome-lint

Fixes #172

sindresorhus commented 11 months ago

Thanks for the quick fix :)