From 6e27b7596cc9286be6467cbbb1dd63819c922020 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Sun, 24 Nov 2019 23:57:04 +0000 Subject: [PATCH] Fix branch when reporting test coverage --- .github/workflows/build.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 672bbc6..5cd5a75 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,12 +4,6 @@ on: [push, pull_request] jobs: build: - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - DATABASE_URL: postgres://postgres@localhost/postgres - GIT_COMMIT_SHA: ${{ github.sha }} - GIT_BRANCH: ${{ github.ref }} - runs-on: ubuntu-latest services: @@ -39,6 +33,8 @@ jobs: gem install bundler bundle install --jobs 4 --retry 3 bundle exec rake + env: + DATABASE_URL: postgres://postgres@localhost/postgres - name: Publish image uses: elgohr/Publish-Docker-Github-Action@master @@ -50,6 +46,7 @@ jobs: - name: Report to Code Climate continue-on-error: true - if: success() - run: ./cc-test-reporter after-build --exit-code $? - + run: GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" ./cc-test-reporter after-build --exit-code $? + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + GIT_COMMIT_SHA: ${{ github.sha }}