diff --git a/.github/workflows/build-os-dependent.yml b/.github/workflows/build-os-dependent.yml index 5512fc5..c4591a9 100644 --- a/.github/workflows/build-os-dependent.yml +++ b/.github/workflows/build-os-dependent.yml @@ -41,6 +41,10 @@ jobs: echo "Short SHA variables" echo " sha : ${{ env.GITHUB_SHA_SHORT }}" echo " pull request sha : ${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" + echo "Branch Name" + echo " raw : ${{ env.GITHUB_BRANCH_NAME }}" + echo " slug : ${{ env.GITHUB_BRANCH_NAME_SLUG }}" + echo " slug url : ${{ env.GITHUB_BRANCH_NAME_SLUG_URL }}" - name: Case Sensitive Output run: | echo "Slug variables" @@ -59,6 +63,9 @@ jobs: echo " head ref : ${{ env.GITHUB_HEAD_REF_SLUG_URL_CS }}" echo " base ref : ${{ env.GITHUB_BASE_REF_SLUG_URL_CS }}" echo " event ref : ${{ env.GITHUB_EVENT_REF_SLUG_URL_CS }}" + echo "Branch Name" + echo " slug : ${{ env.GITHUB_BRANCH_NAME_SLUG_CS }}" + echo " slug url : ${{ env.GITHUB_BRANCH_NAME_SLUG_URL_CS }}" use-on-macos: runs-on: macos-latest @@ -92,6 +99,10 @@ jobs: echo "Short SHA variables" echo " sha : ${{ env.GITHUB_SHA_SHORT }}" echo " pull request sha : ${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" + echo "Branch Name" + echo " raw : ${{ env.GITHUB_BRANCH_NAME }}" + echo " slug : ${{ env.GITHUB_BRANCH_NAME_SLUG }}" + echo " slug url : ${{ env.GITHUB_BRANCH_NAME_SLUG_URL }}" - name: Case Sensitive Output run: | echo "Slug variables" @@ -110,6 +121,9 @@ jobs: echo " head ref : ${{ env.GITHUB_HEAD_REF_SLUG_URL_CS }}" echo " base ref : ${{ env.GITHUB_BASE_REF_SLUG_URL_CS }}" echo " event ref : ${{ env.GITHUB_EVENT_REF_SLUG_URL_CS }}" + echo "Branch Name" + echo " slug : ${{ env.GITHUB_BRANCH_NAME_SLUG_CS }}" + echo " slug url : ${{ env.GITHUB_BRANCH_NAME_SLUG_URL_CS }}" use-on-windows: runs-on: windows-latest @@ -143,6 +157,10 @@ jobs: echo "Short SHA variables" echo " sha : $env:GITHUB_SHA_SHORT" echo " pull request sha : $env:GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT" + echo "Branch Name" + echo " raw : $env:GITHUB_BRANCH_NAME" + echo " slug : $env:GITHUB_BRANCH_NAME_SLUG" + echo " slug url : $env:GITHUB_BRANCH_NAME_SLUG_URL" - name: Case Sensitive Output run: | echo "Slug variables" @@ -161,3 +179,6 @@ jobs: echo " head ref : $env:GITHUB_HEAD_REF_SLUG_URL_CS" echo " base ref : $env:GITHUB_BASE_REF_SLUG_URL_CS" echo " event ref : $env:GITHUB_EVENT_REF_SLUG_URL_CS" + echo "Branch Name" + echo " slug : $env:GITHUB_BRANCH_NAME_SLUG_CS" + echo " slug url : $env:GITHUB_BRANCH_NAME_SLUG_URL_CS" diff --git a/.github/workflows/release-dryrun.yml b/.github/workflows/release-dryrun.yml index 4401910..0bf7284 100644 --- a/.github/workflows/release-dryrun.yml +++ b/.github/workflows/release-dryrun.yml @@ -18,7 +18,7 @@ jobs: with: branches: | [ - "${{ env.GITHUB_REF_SLUG }}" + "${{ env.GITHUB_REF_NAME }}" ] dry_run: true env: diff --git a/README.md b/README.md index 83e3396..c8771ad 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Release][release-badge]][releases] ![Lint][lint-badge] -[![Public workflows that use this action][use-count-badge]][who-use-it] [![Licence][license-badge]][license] This GitHub Action will expose the slug/short values of [some GitHub environment variables][github-env-vars] inside your GitHub workflow. @@ -14,6 +13,7 @@ This GitHub Action will expose the slug/short values of [some GitHub environment - [Overview](#overview) - [Use this action](#use-this-action) - [Available Environment variables](#available-environment-variables) + - [Enhanced variables](#enhanced-variables) - [Partial variables](#partial-variables) - [Slug variables](#slug-variables) - [Slug URL variables](#slug-url-variables) @@ -49,6 +49,8 @@ This GitHub Action will expose the slug/short values of [some GitHub environment

+Additional enhanced environment variables can be compute to help you around GitHub environment variables. + ## Use this action Add this in your workflow @@ -66,6 +68,14 @@ Check for more [examples][examples] (OS usage, URL use, ...) **Note**: If you don't find what you search for, read more about [available `GitHub` variables](docs/github-variables.md), and propose a [new custom variable][custom-variable]. +### Enhanced variables + +- `GITHUB_REF_NAME` will contains the reference name (branch or tag) + - based on `GITHUB_HEAD_REF` in a [`pull-request*`][webhooks-and-events] event context, + - based on `GITHUB_REF` in others event context. + +**NOTE:** All enhanced variables are available in all **slug** formats. + ### Partial variables | Variable | Partial version of | Description | @@ -85,28 +95,28 @@ Check for more [examples][examples] (OS usage, URL use, ...) | [GITHUB_REF_SLUG](docs/slug-variables.md#github_ref_slug) | GITHUB_REF | The branch or tag ref that triggered the workflow. | | [GITHUB_HEAD_REF_SLUG](docs/slug-variables.md#github_head_ref_slug) | GITHUB_HEAD_REF | The branch of the head repository.
Only set for [pull-request][event-pull-request] event and forked repositories. | | [GITHUB_BASE_REF_SLUG](docs/slug-variables.md#github_base_ref_slug) | GITHUB_BASE_REF | The branch of the base repository.
Only set for [pull-request][event-pull-request] event and forked repositories. | -| [GITHUB_EVENT_REF_SLUG](docs/slug-variables.md#github_event_ref_slug) | _github.event.ref_ |
Only set for [following webhook events][4] | +| [GITHUB_EVENT_REF_SLUG](docs/slug-variables.md#github_event_ref_slug) | _github.event.ref_ |
Only set for [following webhook events][webhooks-and-events] | ### Slug URL variables **NOTE:** `_CS` suffix available -| Variable | Slug URL version of | Description | -| --------------------------------------------------------------------------------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------- | -| [GITHUB_REPOSITORY_SLUG_URL](docs/slug-url-variables.md#github_repository_slug_url) | GITHUB_REPOSITORY | The owner and repository name. | -| [GITHUB_REPOSITORY
_OWNER_PART_SLUG_URL](docs/slug-variables.md#github_repository_owner_part_slug_url) | GITHUB_REPOSITORY_OWNER_PART | The owner name. | -| [GITHUB_REPOSITORY
_NAME_PART_SLUG_URL](docs/slug-variables.md#github_repository_name_part_slug_url) | GITHUB_REPOSITORY_NAME_PART | The repository name. | -| [GITHUB_REF_SLUG_URL](docs/slug-url-variables.md#github_ref_slug_url) | GITHUB_REF | The branch or tag ref that triggered the workflow. | -| [GITHUB_HEAD_REF_SLUG_URL](docs/slug-url-variables.md#github_head_ref_slug_url) | GITHUB_HEAD_REF | The branch of the head repository.
Only set for [pull-request][4] event and forked repositories. | -| [GITHUB_BASE_REF_SLUG_URL](docs/slug-url-variables.md#github_base_ref_slug_url) | GITHUB_BASE_REF | The branch of the base repository.
Only set for [pull-request][4] event and forked repositories. | -| [GITHUB_EVENT_REF_SLUG_URL](docs/slug-url-variables.md#github_event_ref_slug_url) | _github.event.ref_ |
Only set for [following webhook events][4] | +| Variable | Slug URL version of | Description | +| --------------------------------------------------------------------------------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| [GITHUB_REPOSITORY_SLUG_URL](docs/slug-url-variables.md#github_repository_slug_url) | GITHUB_REPOSITORY | The owner and repository name. | +| [GITHUB_REPOSITORY
_OWNER_PART_SLUG_URL](docs/slug-variables.md#github_repository_owner_part_slug_url) | GITHUB_REPOSITORY_OWNER_PART | The owner name. | +| [GITHUB_REPOSITORY
_NAME_PART_SLUG_URL](docs/slug-variables.md#github_repository_name_part_slug_url) | GITHUB_REPOSITORY_NAME_PART | The repository name. | +| [GITHUB_REF_SLUG_URL](docs/slug-url-variables.md#github_ref_slug_url) | GITHUB_REF | The branch or tag ref that triggered the workflow. | +| [GITHUB_HEAD_REF_SLUG_URL](docs/slug-url-variables.md#github_head_ref_slug_url) | GITHUB_HEAD_REF | The branch of the head repository.
Only set for [pull-request][webhooks-and-events] event and forked repositories. | +| [GITHUB_BASE_REF_SLUG_URL](docs/slug-url-variables.md#github_base_ref_slug_url) | GITHUB_BASE_REF | The branch of the base repository.
Only set for [pull-request][webhooks-and-events] event and forked repositories. | +| [GITHUB_EVENT_REF_SLUG_URL](docs/slug-url-variables.md#github_event_ref_slug_url) | _github.event.ref_ |
Only set for [following webhook events][webhooks-and-events] | ### Short variables -| Variable | Short version of | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [GITHUB_SHA_SHORT](docs/short-variables.md#github_sha_short) | GITHUB_SHA | The commit SHA that triggered the workflow. | -| [GITHUB_EVENT
_PULL_REQUEST
_HEAD_SHA_SHORT](docs/short-variables.md#github_event_pull_request_head_sha_short) | _github.event
.pull_request
.head.sha_ | The commit SHA on pull request that trigger workflow.
Only set for [following webhook events][4] | +| Variable | Short version of | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [GITHUB_SHA_SHORT](docs/short-variables.md#github_sha_short) | GITHUB_SHA | The commit SHA that triggered the workflow. | +| [GITHUB_EVENT
_PULL_REQUEST
_HEAD_SHA_SHORT](docs/short-variables.md#github_event_pull_request_head_sha_short) | _github.event
.pull_request
.head.sha_ | The commit SHA on pull request that trigger workflow.
Only set for [following webhook events][webhooks-and-events] | ## Contribute @@ -168,7 +178,6 @@ Please, use the current branch `v3.x` or a version tag (see [releases pages][rel [release-badge]: https://img.shields.io/github/workflow/status/rlespinasse/github-slug-action/Release?label=Build&logo=github&style=flat-square [lint-badge]: https://img.shields.io/github/workflow/status/rlespinasse/github-slug-action/Lint?label=Lint&logo=github&style=flat-square -[use-count-badge]: https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fapi-git-master.endbug.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3Drlespinasse%2Fgithub-slug-action%26badge%3Dtrue [license-badge]: https://img.shields.io/github/license/rlespinasse/github-slug-action?style=flat-square [actions]: https://github.com/rlespinasse/github-slug-action/actions @@ -178,10 +187,9 @@ Please, use the current branch `v3.x` or a version tag (see [releases pages][rel [releases]: https://github.com/rlespinasse/github-slug-action/releases [issue-15]: https://github.com/rlespinasse/github-slug-action/issues/15 -[who-use-it]: https://github.com/search?o=desc&q=rlespinasse/github-slug-action+path%3A.github%2Fworkflows+language%3AYAML&s=&type=Code [github-env-vars]: https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables [dependabot]: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot -[event-pull-request]: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads +[webhooks-and-events]: https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads [naming-conventions]: https://docs.github.com/en/actions/reference/environment-variables#naming-conventions-for-environment-variables [article-1]: https://esensconsulting.medium.com/mettre-en-place-une-ci-cd-angular-avec-github-actions-netlify-ca0b59b99ed8 diff --git a/dist/index.js b/dist/index.js index 6f76c70..6b447f4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -110,6 +110,10 @@ const GITHUB_EVENT_PATH = 'GITHUB_EVENT_PATH'; */ const GITHUB_REPOSITORY_OWNER_PART = 'GITHUB_REPOSITORY_OWNER_PART'; const GITHUB_REPOSITORY_NAME_PART = 'GITHUB_REPOSITORY_NAME_PART'; +/** + * New environments variables keys + */ +const GITHUB_REF_NAME = 'GITHUB_REF_NAME'; /** * Slugged outputs environments variables keys */ @@ -127,6 +131,8 @@ const GITHUB_BASE_REF_SLUG = 'GITHUB_BASE_REF_SLUG'; const GITHUB_BASE_REF_SLUG_CS = 'GITHUB_BASE_REF_SLUG_CS'; const GITHUB_EVENT_REF_SLUG = 'GITHUB_EVENT_REF_SLUG'; const GITHUB_EVENT_REF_SLUG_CS = 'GITHUB_EVENT_REF_SLUG_CS'; +const GITHUB_REF_NAME_SLUG = 'GITHUB_REF_NAME_SLUG'; +const GITHUB_REF_NAME_SLUG_CS = 'GITHUB_REF_NAME_SLUG_CS'; /** * URL-Slugged outputs environments variables keys */ @@ -144,6 +150,8 @@ const GITHUB_BASE_REF_SLUG_URL = 'GITHUB_BASE_REF_SLUG_URL'; const GITHUB_BASE_REF_SLUG_URL_CS = 'GITHUB_BASE_REF_SLUG_URL_CS'; const GITHUB_EVENT_REF_SLUG_URL = 'GITHUB_EVENT_REF_SLUG_URL'; const GITHUB_EVENT_REF_SLUG_URL_CS = 'GITHUB_EVENT_REF_SLUG_URL_CS'; +const GITHUB_REF_NAME_SLUG_URL = 'GITHUB_REF_NAME_SLUG_URL'; +const GITHUB_REF_NAME_SLUG_URL_CS = 'GITHUB_REF_NAME_SLUG_URL_CS'; /** * Shorted outputs environments variables keys */ @@ -192,6 +200,7 @@ function run() { exportSlugUrlRef(GITHUB_BASE_REF, GITHUB_BASE_REF_SLUG_URL); exportSlugUrlRefCS(GITHUB_BASE_REF, GITHUB_BASE_REF_SLUG_URL_CS); exportShortSha(GITHUB_SHA, GITHUB_SHA_SHORT); + exportBranchName(); } catch (error) { core.setFailed(error.message); @@ -253,15 +262,21 @@ function exportSecondPartSlug(inputKey, separator, outputKey) { function exportSlugRefCS(inputKey, outputKey) { const envVar = process.env[inputKey]; if (envVar) { - core.exportVariable(outputKey, slug_1.slugref_cs(envVar)); + exportSlugRefCSValue(envVar, outputKey); } } +function exportSlugRefCSValue(envVar, outputKey) { + core.exportVariable(outputKey, slug_1.slugref_cs(envVar)); +} function exportSlugRef(inputKey, outputKey) { const envVar = process.env[inputKey]; if (envVar) { - core.exportVariable(outputKey, slug_1.slugref(envVar)); + exportSlugRefValue(envVar, outputKey); } } +function exportSlugRefValue(envVar, outputKey) { + core.exportVariable(outputKey, slug_1.slugref(envVar)); +} function exportSlugUrlCS(inputKey, outputKey) { const envVar = process.env[inputKey]; if (envVar) { @@ -305,21 +320,45 @@ function exportSecondPartSlugUrl(inputKey, separator, outputKey) { function exportSlugUrlRefCS(inputKey, outputKey) { const envVar = process.env[inputKey]; if (envVar) { - core.exportVariable(outputKey, slug_1.slugurlref_cs(envVar)); + exportSlugUrlRefCSValue(envVar, outputKey); } } +function exportSlugUrlRefCSValue(envVar, outputKey) { + core.exportVariable(outputKey, slug_1.slugurlref_cs(envVar)); +} function exportSlugUrlRef(inputKey, outputKey) { const envVar = process.env[inputKey]; if (envVar) { - core.exportVariable(outputKey, slug_1.slugurlref(envVar)); + exportSlugUrlRefValue(envVar, outputKey); } } +function exportSlugUrlRefValue(envVar, outputKey) { + core.exportVariable(outputKey, slug_1.slugurlref(envVar)); +} function exportShortSha(inputKey, outputKey) { const envVar = process.env[inputKey]; if (envVar) { core.exportVariable(outputKey, short_1.shortsha(envVar)); } } +function exportBranchName() { + //GITHUB_HEAD_REF is only set for pull request events https://docs.github.com/en/actions/reference/environment-variables + const isPullRequest = !!process.env.GITHUB_HEAD_REF; + let refName; + if (isPullRequest) { + refName = process.env.GITHUB_HEAD_REF; + } + else { + refName = process.env.GITHUB_REF; + } + if (refName) { + core.exportVariable(GITHUB_REF_NAME, slug_1.removeRef(refName)); + exportSlugRefValue(refName, GITHUB_REF_NAME_SLUG); + exportSlugRefCSValue(refName, GITHUB_REF_NAME_SLUG_CS); + exportSlugUrlRefValue(refName, GITHUB_REF_NAME_SLUG_URL); + exportSlugUrlRefCSValue(refName, GITHUB_REF_NAME_SLUG_URL_CS); + } +} run(); @@ -435,6 +474,7 @@ exports.getInput = getInput; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { + process.stdout.write(os.EOL); command_1.issueCommand('set-output', { name }, value); } exports.setOutput = setOutput; @@ -738,7 +778,7 @@ exports.get_second_part = get_second_part; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.slugurlref = exports.slugurlref_cs = exports.slugurl = exports.slugurl_cs = exports.slugref = exports.slugref_cs = exports.slug = exports.slug_cs = void 0; +exports.removeRef = exports.slugurlref = exports.slugurlref_cs = exports.slugurl = exports.slugurl_cs = exports.slugref = exports.slugref_cs = exports.slug = exports.slug_cs = void 0; const MAX_SLUG_STRING_SIZE = 63; /** * slug_cs will take envVar and then : @@ -848,6 +888,7 @@ function replaceAnyNonUrlCharactersWithHyphen(envVar) { function removeRef(envVar) { return envVar.replace(RegExp('^refs/(heads|tags|pull)/'), ''); } +exports.removeRef = removeRef; /***/ }), diff --git a/dist/index.js.map b/dist/index.js.map index 17defda..ef166ed 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["/webpack/bootstrap","../external \"os\"","../lib/main.js","../node_modules/@actions/core/lib/core.js","../lib/short.js","../node_modules/@actions/core/lib/utils.js","../node_modules/@actions/core/lib/command.js","../lib/partial.js","../lib/slug.js","../external \"path\"","../node_modules/@actions/core/lib/file-command.js","../external \"fs\""],"names":[],"mappings":";;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC3CA,+B;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFA8FkF,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9F5E;AACb;AACA,2BAA2B,+DAA+D,gBAAgB,EAAE,EAAE;AAC9G;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,qFAAqF;AACpH;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,kBAAkB,mBAAO,CAAC,GAAW;AACrC,uBAAuB,mBAAO,CAAC,GAAgB;AAC/C,gBAAgB,mBAAO,CAAC,GAAS;AACjC,wBAAwB,mBAAO,CAAC,EAAI;AACpC,0BAA0B,mBAAO,CAAC,GAAM;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,aAAa,OAAO,cAAc,OAAO,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,KAAK,IAAI,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU;AAChG;AACA;AACA;AACA,2CAA2C,OAAO;AAClD;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,6BAA6B,UAAU,EAAE,eAAe,EAAE,oBAAoB;AAC9E;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,sCAAsC;AAC3E;AACA,4DAA4D,KAAK;AACjE;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,KAAK;AACrC;AACA,OAAO;AACP,gC;;;;;;;;AC7Oa;AACb,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;;;;;;;;ACZM;AACb;AACA;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,iC;;;;;;;;AClBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,wBAAwB,mBAAO,CAAC,EAAI;AACpC,gBAAgB,mBAAO,CAAC,GAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,yBAAyB;AACzB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,IAAI,GAAG,oBAAoB;AAChE;AACA;AACA;AACA;AACA,qBAAqB,WAAW,EAAE,yBAAyB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mC;;;;;;;;AC9Ea;AACb,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,OAAO,mBAAmB,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,UAAU;AAC9C;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,UAAU;AACjD;AACA,OAAO;;;;;;;;;ACpBM;AACb,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,OAAO,cAAc,OAAO,iBAAiB,OAAO,WAAW,OAAO,cAAc,OAAO,WAAW,OAAO,cAAc,OAAO,QAAQ,OAAO;AACjJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/GA,iC;;;;;;;;ACAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D;AACA;AACA,wBAAwB,mBAAO,CAAC,GAAI;AACpC,wBAAwB,mBAAO,CAAC,EAAI;AACpC,gBAAgB,mBAAO,CAAC,GAAS;AACjC;AACA,2CAA2C,QAAQ;AACnD;AACA,gFAAgF,QAAQ;AACxF;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA,mCAAmC,gCAAgC,EAAE,OAAO;AAC5E;AACA,KAAK;AACL;AACA,OAAO;AACP,wC;;;;;;;AC5BA,+B","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tvar threw = true;\n \t\ttry {\n \t\t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n \t\t\tthrew = false;\n \t\t} finally {\n \t\t\tif(threw) delete installedModules[moduleId];\n \t\t}\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t__webpack_require__.ab = __dirname + \"/\";\n\n \t// the startup function\n \tfunction startup() {\n \t\t// Load entry module and return exports\n \t\treturn __webpack_require__(109);\n \t};\n\n \t// run startup\n \treturn startup();\n","module.exports = require(\"os\");",null,"\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input. The value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n */\nfunction error(message) {\n command_1.issue('error', message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds an warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n */\nfunction warning(message) {\n command_1.issue('warning', message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shortsha = void 0;\nconst SHORT_SHA_SIZE = 8;\n/**\n * slug will take envVar and then :\n * - limit the string size to 8 characters\n * @param envVar to be slugged\n */\nfunction shortsha(envVar) {\n return envVar.substring(0, SHORT_SHA_SIZE);\n}\nexports.shortsha = shortsha;\n","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.get_second_part = exports.get_first_part = void 0;\n/**\n * Get the first part of envVar\n * @param envVar to be split\n * @param separator of the split\n */\nfunction get_first_part(envVar, separator) {\n return envVar.replace(RegExp(`${separator}.*$`), '');\n}\nexports.get_first_part = get_first_part;\n/**\n * Get the second part of envVar\n * @param envVar to be split\n * @param separator of the split\n */\nfunction get_second_part(envVar, separator) {\n return envVar.replace(RegExp(`^.*${separator}`), '');\n}\nexports.get_second_part = get_second_part;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.slugurlref = exports.slugurlref_cs = exports.slugurl = exports.slugurl_cs = exports.slugref = exports.slugref_cs = exports.slug = exports.slug_cs = void 0;\nconst MAX_SLUG_STRING_SIZE = 63;\n/**\n * slug_cs will take envVar and then :\n * - replace any character by `-` except `0-9`, `a-z`, `.`, and `_`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slug_cs(envVar) {\n return trailHyphen(replaceAnyNonAlphanumericCharacter(envVar)).substring(0, MAX_SLUG_STRING_SIZE);\n}\nexports.slug_cs = slug_cs;\n/**\n * slug will take envVar and then :\n * - put the variable content in lower case\n * - replace any character by `-` except `0-9`, `a-z`, `.`, and `_`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slug(envVar) {\n return slug_cs(envVar.toLowerCase());\n}\nexports.slug = slug;\n/**\n * slugref_cs will take envVar and then :\n * - remove refs/(heads|tags|pull)/\n * - replace any character by `-` except `0-9`, `a-z`, `.`, and `_`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugref_cs(envVar) {\n return slug_cs(removeRef(envVar));\n}\nexports.slugref_cs = slugref_cs;\n/**\n * slugref will take envVar and then :\n * - remove refs/(heads|tags|pull)/\n * - put the variable content in lower case\n * - replace any character by `-` except `0-9`, `a-z`, `.`, and `_`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugref(envVar) {\n return slugref_cs(envVar.toLowerCase());\n}\nexports.slugref = slugref;\n/**\n * slugurl_cs will take envVar and then :\n * - replace any character by `-` except `0-9`, `a-z`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugurl_cs(envVar) {\n return slug_cs(replaceAnyNonUrlCharactersWithHyphen(envVar));\n}\nexports.slugurl_cs = slugurl_cs;\n/**\n * slugurl will take envVar and then :\n * - put the variable content in lower case\n * - replace any character by `-` except `0-9`, `a-z`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugurl(envVar) {\n return slug(replaceAnyNonUrlCharactersWithHyphen(envVar));\n}\nexports.slugurl = slugurl;\n/**\n * slugurlref_cs will take envVar and then :\n * - remove refs/(heads|tags|pull)/\n * - replace any character by `-` except `0-9`, `a-z`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugurlref_cs(envVar) {\n return slugurl_cs(slugref_cs(envVar));\n}\nexports.slugurlref_cs = slugurlref_cs;\n/**\n * slugurlref will take envVar and then :\n * - remove refs/(heads|tags|pull)/\n * - put the variable content in lower case\n * - replace any character by `-` except `0-9`, `a-z`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugurlref(envVar) {\n return slugurl(slugref(envVar));\n}\nexports.slugurlref = slugurlref;\nfunction trailHyphen(envVar) {\n return envVar.replace(RegExp('^-*', 'g'), '').replace(RegExp('-*$', 'g'), '');\n}\nfunction replaceAnyNonAlphanumericCharacter(envVar) {\n return envVar.replace(RegExp('[^a-zA-Z0-9._]', 'g'), '-');\n}\nfunction replaceAnyNonUrlCharactersWithHyphen(envVar) {\n return envVar.replace(RegExp('[._]', 'g'), '-');\n}\nfunction removeRef(envVar) {\n return envVar.replace(RegExp('^refs/(heads|tags|pull)/'), '');\n}\n","module.exports = require(\"path\");","\"use strict\";\n// For internal use, subject to change.\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","module.exports = require(\"fs\");"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["/webpack/bootstrap","../external \"os\"","../lib/main.js","../node_modules/@actions/core/lib/core.js","../lib/short.js","../node_modules/@actions/core/lib/utils.js","../node_modules/@actions/core/lib/command.js","../lib/partial.js","../lib/slug.js","../external \"path\"","../node_modules/@actions/core/lib/file-command.js","../external \"fs\""],"names":[],"mappings":";;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AC3CA,+B;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAsGkF,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtG5E;AACb;AACA,2BAA2B,+DAA+D,gBAAgB,EAAE,EAAE;AAC9G;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,qFAAqF;AACpH;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,kBAAkB,mBAAO,CAAC,GAAW;AACrC,uBAAuB,mBAAO,CAAC,GAAgB;AAC/C,gBAAgB,mBAAO,CAAC,GAAS;AACjC,wBAAwB,mBAAO,CAAC,EAAI;AACpC,0BAA0B,mBAAO,CAAC,GAAM;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,aAAa,OAAO,cAAc,OAAO,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,KAAK,IAAI,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU;AAChG;AACA;AACA;AACA,2CAA2C,OAAO;AAClD;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,6BAA6B,UAAU,EAAE,eAAe,EAAE,oBAAoB;AAC9E;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,sCAAsC;AAC3E;AACA,4DAA4D,KAAK;AACjE;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,KAAK;AACrC;AACA,OAAO;AACP,gC;;;;;;;;AC9Oa;AACb,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;;;;;;;;ACZM;AACb;AACA;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,iC;;;;;;;;AClBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,wBAAwB,mBAAO,CAAC,EAAI;AACpC,gBAAgB,mBAAO,CAAC,GAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,yBAAyB;AACzB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,IAAI,GAAG,oBAAoB;AAChE;AACA;AACA;AACA;AACA,qBAAqB,WAAW,EAAE,yBAAyB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mC;;;;;;;;AC9Ea;AACb,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,OAAO,mBAAmB,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,UAAU;AAC9C;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,UAAU;AACjD;AACA,OAAO;;;;;;;;;ACpBM;AACb,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D,OAAO,aAAa,OAAO,cAAc,OAAO,iBAAiB,OAAO,WAAW,OAAO,cAAc,OAAO,WAAW,OAAO,cAAc,OAAO,QAAQ,OAAO;AACrK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;;;;;;;AChHP,iC;;;;;;;;ACAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO,iBAAiB,cAAc;AAC5D;AACA;AACA,wBAAwB,mBAAO,CAAC,GAAI;AACpC,wBAAwB,mBAAO,CAAC,EAAI;AACpC,gBAAgB,mBAAO,CAAC,GAAS;AACjC;AACA,2CAA2C,QAAQ;AACnD;AACA,gFAAgF,QAAQ;AACxF;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA,mCAAmC,gCAAgC,EAAE,OAAO;AAC5E;AACA,KAAK;AACL;AACA,OAAO;AACP,wC;;;;;;;AC5BA,+B","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tvar threw = true;\n \t\ttry {\n \t\t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n \t\t\tthrew = false;\n \t\t} finally {\n \t\t\tif(threw) delete installedModules[moduleId];\n \t\t}\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t__webpack_require__.ab = __dirname + \"/\";\n\n \t// the startup function\n \tfunction startup() {\n \t\t// Load entry module and return exports\n \t\treturn __webpack_require__(109);\n \t};\n\n \t// run startup\n \treturn startup();\n","module.exports = require(\"os\");",null,"\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input. The value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n */\nfunction error(message) {\n command_1.issue('error', message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds an warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n */\nfunction warning(message) {\n command_1.issue('warning', message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\n//# sourceMappingURL=core.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shortsha = void 0;\nconst SHORT_SHA_SIZE = 8;\n/**\n * slug will take envVar and then :\n * - limit the string size to 8 characters\n * @param envVar to be slugged\n */\nfunction shortsha(envVar) {\n return envVar.substring(0, SHORT_SHA_SIZE);\n}\nexports.shortsha = shortsha;\n","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.get_second_part = exports.get_first_part = void 0;\n/**\n * Get the first part of envVar\n * @param envVar to be split\n * @param separator of the split\n */\nfunction get_first_part(envVar, separator) {\n return envVar.replace(RegExp(`${separator}.*$`), '');\n}\nexports.get_first_part = get_first_part;\n/**\n * Get the second part of envVar\n * @param envVar to be split\n * @param separator of the split\n */\nfunction get_second_part(envVar, separator) {\n return envVar.replace(RegExp(`^.*${separator}`), '');\n}\nexports.get_second_part = get_second_part;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.removeRef = exports.slugurlref = exports.slugurlref_cs = exports.slugurl = exports.slugurl_cs = exports.slugref = exports.slugref_cs = exports.slug = exports.slug_cs = void 0;\nconst MAX_SLUG_STRING_SIZE = 63;\n/**\n * slug_cs will take envVar and then :\n * - replace any character by `-` except `0-9`, `a-z`, `.`, and `_`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slug_cs(envVar) {\n return trailHyphen(replaceAnyNonAlphanumericCharacter(envVar)).substring(0, MAX_SLUG_STRING_SIZE);\n}\nexports.slug_cs = slug_cs;\n/**\n * slug will take envVar and then :\n * - put the variable content in lower case\n * - replace any character by `-` except `0-9`, `a-z`, `.`, and `_`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slug(envVar) {\n return slug_cs(envVar.toLowerCase());\n}\nexports.slug = slug;\n/**\n * slugref_cs will take envVar and then :\n * - remove refs/(heads|tags|pull)/\n * - replace any character by `-` except `0-9`, `a-z`, `.`, and `_`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugref_cs(envVar) {\n return slug_cs(removeRef(envVar));\n}\nexports.slugref_cs = slugref_cs;\n/**\n * slugref will take envVar and then :\n * - remove refs/(heads|tags|pull)/\n * - put the variable content in lower case\n * - replace any character by `-` except `0-9`, `a-z`, `.`, and `_`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugref(envVar) {\n return slugref_cs(envVar.toLowerCase());\n}\nexports.slugref = slugref;\n/**\n * slugurl_cs will take envVar and then :\n * - replace any character by `-` except `0-9`, `a-z`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugurl_cs(envVar) {\n return slug_cs(replaceAnyNonUrlCharactersWithHyphen(envVar));\n}\nexports.slugurl_cs = slugurl_cs;\n/**\n * slugurl will take envVar and then :\n * - put the variable content in lower case\n * - replace any character by `-` except `0-9`, `a-z`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugurl(envVar) {\n return slug(replaceAnyNonUrlCharactersWithHyphen(envVar));\n}\nexports.slugurl = slugurl;\n/**\n * slugurlref_cs will take envVar and then :\n * - remove refs/(heads|tags|pull)/\n * - replace any character by `-` except `0-9`, `a-z`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugurlref_cs(envVar) {\n return slugurl_cs(slugref_cs(envVar));\n}\nexports.slugurlref_cs = slugurlref_cs;\n/**\n * slugurlref will take envVar and then :\n * - remove refs/(heads|tags|pull)/\n * - put the variable content in lower case\n * - replace any character by `-` except `0-9`, `a-z`\n * - remove leading and trailing `-` character\n * - limit the string size to 63 characters\n * @param envVar to be slugged\n */\nfunction slugurlref(envVar) {\n return slugurl(slugref(envVar));\n}\nexports.slugurlref = slugurlref;\nfunction trailHyphen(envVar) {\n return envVar.replace(RegExp('^-*', 'g'), '').replace(RegExp('-*$', 'g'), '');\n}\nfunction replaceAnyNonAlphanumericCharacter(envVar) {\n return envVar.replace(RegExp('[^a-zA-Z0-9._]', 'g'), '-');\n}\nfunction replaceAnyNonUrlCharactersWithHyphen(envVar) {\n return envVar.replace(RegExp('[._]', 'g'), '-');\n}\nfunction removeRef(envVar) {\n return envVar.replace(RegExp('^refs/(heads|tags|pull)/'), '');\n}\nexports.removeRef = removeRef;\n","module.exports = require(\"path\");","\"use strict\";\n// For internal use, subject to change.\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","module.exports = require(\"fs\");"],"sourceRoot":""} \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index f659961..0b7f7b0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,6 @@ import * as core from '@actions/core' import { + removeRef, slug, slug_cs, slugref, @@ -31,6 +32,11 @@ const GITHUB_EVENT_PATH = 'GITHUB_EVENT_PATH' const GITHUB_REPOSITORY_OWNER_PART = 'GITHUB_REPOSITORY_OWNER_PART' const GITHUB_REPOSITORY_NAME_PART = 'GITHUB_REPOSITORY_NAME_PART' +/** + * New environments variables keys + */ +const GITHUB_REF_NAME = 'GITHUB_REF_NAME' + /** * Slugged outputs environments variables keys */ @@ -50,6 +56,8 @@ const GITHUB_BASE_REF_SLUG = 'GITHUB_BASE_REF_SLUG' const GITHUB_BASE_REF_SLUG_CS = 'GITHUB_BASE_REF_SLUG_CS' const GITHUB_EVENT_REF_SLUG = 'GITHUB_EVENT_REF_SLUG' const GITHUB_EVENT_REF_SLUG_CS = 'GITHUB_EVENT_REF_SLUG_CS' +const GITHUB_REF_NAME_SLUG = 'GITHUB_REF_NAME_SLUG' +const GITHUB_REF_NAME_SLUG_CS = 'GITHUB_REF_NAME_SLUG_CS' /** * URL-Slugged outputs environments variables keys @@ -72,6 +80,8 @@ const GITHUB_BASE_REF_SLUG_URL = 'GITHUB_BASE_REF_SLUG_URL' const GITHUB_BASE_REF_SLUG_URL_CS = 'GITHUB_BASE_REF_SLUG_URL_CS' const GITHUB_EVENT_REF_SLUG_URL = 'GITHUB_EVENT_REF_SLUG_URL' const GITHUB_EVENT_REF_SLUG_URL_CS = 'GITHUB_EVENT_REF_SLUG_URL_CS' +const GITHUB_REF_NAME_SLUG_URL = 'GITHUB_REF_NAME_SLUG_URL' +const GITHUB_REF_NAME_SLUG_URL_CS = 'GITHUB_REF_NAME_SLUG_URL_CS' /** * Shorted outputs environments variables keys @@ -168,6 +178,8 @@ async function run(): Promise { exportSlugUrlRefCS(GITHUB_BASE_REF, GITHUB_BASE_REF_SLUG_URL_CS) exportShortSha(GITHUB_SHA, GITHUB_SHA_SHORT) + + exportBranchName() } catch (error) { core.setFailed(error.message) } @@ -259,17 +271,25 @@ function exportSecondPartSlug( function exportSlugRefCS(inputKey: string, outputKey: string): void { const envVar = process.env[inputKey] if (envVar) { - core.exportVariable(outputKey, slugref_cs(envVar)) + exportSlugRefCSValue(envVar, outputKey) } } +function exportSlugRefCSValue(envVar: string, outputKey: string): void { + core.exportVariable(outputKey, slugref_cs(envVar)) +} + function exportSlugRef(inputKey: string, outputKey: string): void { const envVar = process.env[inputKey] if (envVar) { - core.exportVariable(outputKey, slugref(envVar)) + exportSlugRefValue(envVar, outputKey) } } +function exportSlugRefValue(envVar: string, outputKey: string): void { + core.exportVariable(outputKey, slugref(envVar)) +} + function exportSlugUrlCS(inputKey: string, outputKey: string): void { const envVar = process.env[inputKey] if (envVar) { @@ -334,17 +354,25 @@ function exportSecondPartSlugUrl( function exportSlugUrlRefCS(inputKey: string, outputKey: string): void { const envVar = process.env[inputKey] if (envVar) { - core.exportVariable(outputKey, slugurlref_cs(envVar)) + exportSlugUrlRefCSValue(envVar, outputKey) } } +function exportSlugUrlRefCSValue(envVar: string, outputKey: string): void { + core.exportVariable(outputKey, slugurlref_cs(envVar)) +} + function exportSlugUrlRef(inputKey: string, outputKey: string): void { const envVar = process.env[inputKey] if (envVar) { - core.exportVariable(outputKey, slugurlref(envVar)) + exportSlugUrlRefValue(envVar, outputKey) } } +function exportSlugUrlRefValue(envVar: string, outputKey: string): void { + core.exportVariable(outputKey, slugurlref(envVar)) +} + function exportShortSha(inputKey: string, outputKey: string): void { const envVar = process.env[inputKey] if (envVar) { @@ -352,4 +380,22 @@ function exportShortSha(inputKey: string, outputKey: string): void { } } +function exportBranchName(): void { + //GITHUB_HEAD_REF is only set for pull request events https://docs.github.com/en/actions/reference/environment-variables + const isPullRequest = !!process.env.GITHUB_HEAD_REF + let refName + if (isPullRequest) { + refName = process.env.GITHUB_HEAD_REF + } else { + refName = process.env.GITHUB_REF + } + if (refName) { + core.exportVariable(GITHUB_REF_NAME, removeRef(refName)) + exportSlugRefValue(refName, GITHUB_REF_NAME_SLUG) + exportSlugRefCSValue(refName, GITHUB_REF_NAME_SLUG_CS) + exportSlugUrlRefValue(refName, GITHUB_REF_NAME_SLUG_URL) + exportSlugUrlRefCSValue(refName, GITHUB_REF_NAME_SLUG_URL_CS) + } +} + run() diff --git a/src/slug.ts b/src/slug.ts index 7919bc9..a94d6dd 100644 --- a/src/slug.ts +++ b/src/slug.ts @@ -111,6 +111,6 @@ function replaceAnyNonUrlCharactersWithHyphen(envVar: string): string { return envVar.replace(RegExp('[._]', 'g'), '-') } -function removeRef(envVar: string): string { +export function removeRef(envVar: string): string { return envVar.replace(RegExp('^refs/(heads|tags|pull)/'), '') }