From 8430ca8ec5819fd294e534f746ebae2a61594c3c Mon Sep 17 00:00:00 2001 From: GP Date: Wed, 26 Feb 2020 09:54:45 +0530 Subject: [PATCH 1/4] main: Report the correct Git branch name for PRs. --- src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.ts b/src/main.ts index ae9dff3b..acacd843 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,6 +40,11 @@ function prepareEnv() { if (env.GIT_BRANCH) env.GIT_BRANCH = env.GIT_BRANCH.replace(/^refs\/heads\//, ''); // Remove 'refs/heads/' prefix (See https://github.com/paambaati/codeclimate-action/issues/42) + + if (process.env.GITHUB_EVENT_NAME === 'pull_request') { + env.GIT_BRANCH = process.env.GITHUB_HEAD_REF || env.GIT_BRANCH; // Report correct branch for PRs (See https://github.com/paambaati/codeclimate-action/issues/86) + } + return env; } From 515e102ee8bde72436bf6c22530fae3151670241 Mon Sep 17 00:00:00 2001 From: GP Date: Wed, 26 Feb 2020 09:59:32 +0530 Subject: [PATCH 2/4] =?UTF-8?q?package:=20=E2=AC=86=EF=B8=8F=20codeclimate?= =?UTF-8?q?-action@2.510.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1a2d2c1f..54829da3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "codeclimate-action", - "version": "2.5.0", + "version": "2.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bfb1c040..debe0144 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeclimate-action", - "version": "2.5.0", + "version": "2.5.1", "private": true, "description": "Publish code coverage to Code Climate", "main": "lib/main.js", From 78c7125dd2320d0d132b5d6b071c3fe349677425 Mon Sep 17 00:00:00 2001 From: GP Date: Wed, 26 Feb 2020 09:59:54 +0530 Subject: [PATCH 3/4] docs: Update default version in examples. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32a0dd15..cb73b9d9 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This action requires that you set the [`CC_TEST_REPORTER_ID`](https://docs.codec ```yaml steps: - name: Test & publish code coverage - uses: paambaati/codeclimate-action@v2.5.0 + uses: paambaati/codeclimate-action@v2.5.1 env: CC_TEST_REPORTER_ID: with: @@ -36,7 +36,7 @@ steps: ```yaml steps: - name: Test & publish code coverage - uses: paambaati/codeclimate-action@v2.5.0 + uses: paambaati/codeclimate-action@v2.5.1 env: # Set CC_TEST_REPORTER_ID as secret of your repo CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} From 87a66a5118a90cea1e5f862fe57ca3d40f8d671f Mon Sep 17 00:00:00 2001 From: GP Date: Wed, 26 Feb 2020 10:00:10 +0530 Subject: [PATCH 4/4] docs: Update changelog for upcoming v2.5.1 release. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42a2af48..541edc5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +# [2.5.1] - 2020-02-26 +### Fixed +- Fix reporting the [wrong branch name for PRs](https://github.com/paambaati/codeclimate-action/issues/86) - via [`#115`](https://github.com/paambaati/codeclimate-action/pull/115). + # [2.5.0] - 2020-02-25 ### Added - Custom `--prefix` support - via [`#111`](https://github.com/paambaati/codeclimate-action/pull/111).