Skip to content

Commit

Permalink
can't override env variables, use script.sh directly
Browse files Browse the repository at this point in the history
  • Loading branch information
toy committed Jul 12, 2024
1 parent 520b680 commit b1804b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion test/only_checked/mock_bins/rubocop
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b1804b7

Please sign in to comment.