From bf9f47a0005bb4c06ca8435b9c7e754a879383fb Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 11 Apr 2023 14:22:59 +1000 Subject: [PATCH] Show commit in CI actions/checkout@v3 actually creates a merge commit into master, to ensure you're testing the latest as close to master as possible. That's all well and good, but quite confusing when you see errors in CI that aren't present in the actual PR branch. Hopefully this will be a clue when such confusions arise. --- .github/workflows/brakeman-analysis.yml | 1 + .github/workflows/build.yml | 3 +-- .github/workflows/linters.yml | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/brakeman-analysis.yml b/.github/workflows/brakeman-analysis.yml index f3a3748990..3e7379e84c 100644 --- a/.github/workflows/brakeman-analysis.yml +++ b/.github/workflows/brakeman-analysis.yml @@ -41,6 +41,7 @@ jobs: - name: Scan continue-on-error: true run: | + git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3) brakeman -f sarif -o output.sarif.json . # Upload the SARIF file generated in the previous step diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c16ec044a..1d19e1ff0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,6 @@ jobs: bundle exec rake db:schema:load - name: Run tests - env: KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 864ef557d85ea8e603e086c0387d5154 KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} @@ -82,8 +81,8 @@ jobs: # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/controllers/**/*_spec.rb}" - run: | + git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3) bundle exec rake knapsack_pro:rspec knapsack_rspec_models: diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index e2bfd9c8c0..fa30eb7d99 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -9,7 +9,11 @@ jobs: steps: - name: Check out code uses: actions/checkout@v1 + - uses: ruby/setup-ruby@v1 + + - run: git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3) + - name: rubocop uses: reviewdog/action-rubocop@v2 with: @@ -32,6 +36,8 @@ jobs: - name: Install JS dependencies run: yarn install --frozen-lockfile + - run: git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3) + - name: prettier uses: EPMatt/reviewdog-action-prettier@v1 with: