Skip to content

Commit

Permalink
ci(lint): do not fail linter on push events (#5331)
Browse files Browse the repository at this point in the history
Previous behavior:
The following error was causing an exit 1 in GitHub Actions when a pushing
to the `main` branch

```
Error: Similar commit hashes detected: previous sha is equivalent to the
current sha
```

Expeceted behavior:
Allow the linter to run succesfully even if the previous SHA has no files
changed

Solution:
Add `fetch-depth: 2` to retrieve the preceding commit
  • Loading branch information
gustavovalverde authored Oct 4, 2022
1 parent 9f6a1fd commit a418985
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
id: changed-files-rust
uses: tj-actions/[email protected]
with:
fetch-depth: 2
files: |
**/*.rs
**/Cargo.toml
Expand All @@ -53,6 +54,7 @@ jobs:
id: changed-files-workflows
uses: tj-actions/[email protected]
with:
fetch-depth: 2
files: |
.github/workflows/*.yml
Expand Down

0 comments on commit a418985

Please sign in to comment.