diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 2d32f03..fb4d409 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -126,6 +126,7 @@ jobs: echo "CI_REF=$CI_REF" echo "CI_HEAD_REF_SLUG=$CI_HEAD_REF_SLUG" echo "CI_HEAD_REF=$CI_HEAD_REF" + echo "CI_BASE_REF_SLUG=$CI_BASE_REF_SLUG" echo "CI_BASE_REF=$CI_BASE_REF" echo "CI_SHA_SHORT=$CI_SHA_SHORT" echo "CI_SHA=$CI_SHA" diff --git a/README.md b/README.md index a7e70e7..6c5ba5e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![GitHub Action: View on Marketplace](https://img.shields.io/badge/GitHub%20Action-View_on_Marketplace-28a745?logo=github)](https://github.com/marketplace/actions/github-environment-variables-action) [![Demo: available](https://img.shields.io/badge/Demo-available-orange)](.github/workflows/demo.yml) -[![Version: v2.4.0](https://img.shields.io/badge/Version-v2.4.0-brightgreen)](https://github.com/FranzDiebold/github-env-vars-action/releases/tag/v2.4.0) +[![Version: v2.5.0](https://img.shields.io/badge/Version-v2.5.0-brightgreen)](https://github.com/FranzDiebold/github-env-vars-action/releases/tag/v2.5.0) [![Lint and Test](https://github.com/FranzDiebold/github-env-vars-action/workflows/Lint%20and%20Test/badge.svg)](https://github.com/FranzDiebold/github-env-vars-action/actions?query=workflow%3A%22Lint+and+Test%22) [![license: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](./LICENSE) diff --git a/dist/index.js b/dist/index.js index 44030f4..996f6c0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -192,6 +192,13 @@ try { const pullRequest = github.context.payload && github.context.payload.pull_request; if (pullRequest) { + const prSha = github.event.pull_request.head.sha; + core.exportVariable('CI_PR_SHA_SHORT', getShaShort(prSha)); + core.info(`Set CI_PR_SHA_SHORT=${process.env.CI_PR_SHA_SHORT}`); + + core.exportVariable('CI_PR_SHA', prSha); + core.info(`Set CI_PR_SHA=${process.env.CI_PR_SHA}`); + const prNumber = pullRequest.number; core.exportVariable('CI_PR_NUMBER', prNumber); core.info(`Set CI_PR_NUMBER=${process.env.CI_PR_NUMBER}`); diff --git a/package-lock.json b/package-lock.json index 493f2e5..b7c9b34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "github-env-vars-action", - "version": "2.4.0", + "version": "2.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "github-env-vars-action", - "version": "2.4.0", + "version": "2.5.0", "license": "MIT", "dependencies": { "@actions/core": "^1.9.0", diff --git a/package.json b/package.json index 3f73b0e..54bb08d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-env-vars-action", - "version": "2.4.0", + "version": "2.5.0", "description": "A GitHub Action to expose useful environment variables.", "main": "index.js", "scripts": {