Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from opf/revert-9-fail-on-fetching-not-enough
Browse files Browse the repository at this point in the history
Revert "Fail on fetching not enough"
  • Loading branch information
dombesz authored Jun 3, 2024
2 parents e000b11 + 367d389 commit 5e2bee7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ jobs:
BUNDLE_GEMFILE: ${{ github.workspace }}/test/using_bundler/Gemfile
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # we are comparing PR merge head with base
- name: Fetch all commits for PR branch plus head commit of base branch
run: |
# fetch all commits of the PR branch
git fetch --shallow-exclude "${{ github.base_ref }}" origin "${{ github.ref }}"
# fix for "fatal: error in object: unshallow"
git repack -d
# fetch head commit of base branch
git fetch --deepen 1 origin "${{ github.ref }}"
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
Expand Down
5 changes: 2 additions & 3 deletions script.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

set -e
set -o pipefail

cd "${GITHUB_WORKSPACE}/${INPUT_WORKDIR}" || exit
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
Expand Down Expand Up @@ -96,8 +95,8 @@ if [ "${INPUT_ONLY_CHANGED}" = "true" ]; then
# shellcheck disable=SC2086
readarray -t CHANGED_FILES < <(
comm -12 \
<(git diff --diff-filter=d --name-only "${BASE_REF}..${HEAD_REF}" | sort || kill $$) \
<(${BUNDLE_EXEC}rubocop --list-target-files | sort || kill $$)
<(git diff --diff-filter=d --name-only "${BASE_REF}..${HEAD_REF}" | sort) \
<(${BUNDLE_EXEC}rubocop --list-target-files | sort)
)

if (( ${#CHANGED_FILES[@]} == 0 )); then
Expand Down

0 comments on commit 5e2bee7

Please sign in to comment.