From a4189857fd1dab4e00779fc73384623f84c2851a Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Tue, 4 Oct 2022 15:00:44 -0400 Subject: [PATCH] ci(lint): do not fail linter on `push` events (#5331) 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 --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bab1a201629..5dc33884910 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -41,6 +41,7 @@ jobs: id: changed-files-rust uses: tj-actions/changed-files@v29.0.7 with: + fetch-depth: 2 files: | **/*.rs **/Cargo.toml @@ -53,6 +54,7 @@ jobs: id: changed-files-workflows uses: tj-actions/changed-files@v29.0.7 with: + fetch-depth: 2 files: | .github/workflows/*.yml