From b1804b79c4e870888c9729918287f590829f8382 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Fri, 12 Jul 2024 19:22:07 +0200 Subject: [PATCH] can't override env variables, use script.sh directly --- .github/workflows/ci.yml | 19 +++++++++---------- test/only_checked/mock_bins/rubocop | 3 ++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be9a5e1..b1aadb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,18 +5,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - id: create-commit - run: | + - run: | cp test/only_checked/files/* . git add * git config user.email "workflow@github.com" git config user.name "I am an automated workflow" git commit -m auto - echo "HEAD_REF=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - name: rubocop with only_checked - uses: ./ - with: - only_changed: 'true' - env: - PATH: test/only_checked/mock_bins:${{ env.PATH }} - HEAD_REF: ${{ steps.create-commit.outputs.HEAD_REF }} + + PATH="test/only_checked/mock_bins:$PATH" \ + BASE_REF=$(git rev-parse HEAD~) \ + HEAD_REF=$(git rev-parse HEAD) \ + INPUT_ONLY_CHANGED=true \ + INPUT_USE_BUNDLER=false \ + ./script.sh + shell: bash diff --git a/test/only_checked/mock_bins/rubocop b/test/only_checked/mock_bins/rubocop index ddfda21..a20c585 100755 --- a/test/only_checked/mock_bins/rubocop +++ b/test/only_checked/mock_bins/rubocop @@ -3,7 +3,8 @@ case ARGV when %w[--list-target-files] puts %w[a.rb b.rb c.rb] - +when %W[--require #{ENV['GITHUB_ACTION_PATH']}/rdjson_formatter/rdjson_formatter.rb --format RdjsonFormatter --fail-level error a.rb] + puts '{"source":{"name":"rubocop","url":"https://rubocop.org/"},"diagnostics":[],"severity":"INFO"}' else abort "rubocop mock called with unexpected arguments:\n#{ARGV.join("\n")}" end