Merge pull request #38 from FranzDiebold/v-2-2-0

v2.2.0
This commit is contained in:
Franz Diebold 2021-05-02 20:24:35 +02:00 committed by GitHub
commit 3bfb88dbb2
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6875 additions and 208 deletions

View file

@ -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) [![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) [![Demo: available](https://img.shields.io/badge/Demo-available-orange)](.github/workflows/demo.yml)
[![Version: v2.1.0](https://img.shields.io/badge/Version-v2.1.0-brightgreen)](https://github.com/FranzDiebold/github-env-vars-action/releases/tag/v2.1.0) [![Version: v2.2.0](https://img.shields.io/badge/Version-v2.2.0-brightgreen)](https://github.com/FranzDiebold/github-env-vars-action/releases/tag/v2.2.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) [![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) [![license: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](./LICENSE)

68
dist/index.js vendored
View file

@ -1,13 +1,12 @@
module.exports =
/******/ (() => { // webpackBootstrap /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({ /******/ var __webpack_modules__ = ({
/***/ 932: /***/ 932:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
// Franz Diebold // Franz Diebold
const core = __webpack_require__(186); const core = __nccwpck_require__(186);
/** /**
* Slugify a given string. * Slugify a given string.
@ -70,7 +69,7 @@ try {
core.info(`Set CI_REPOSITORY_SLUG=` + core.info(`Set CI_REPOSITORY_SLUG=` +
`${process.env.CI_REPOSITORY_SLUG}`); `${process.env.CI_REPOSITORY_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REPOSITORY" not set. ' + core.info('Environment variable "GITHUB_REPOSITORY" not set. ' +
'Cannot set "CI_REPOSITORY_SLUG".'); 'Cannot set "CI_REPOSITORY_SLUG".');
} }
@ -85,7 +84,7 @@ try {
core.info(`Set CI_REPOSITORY_OWNER_SLUG=` + core.info(`Set CI_REPOSITORY_OWNER_SLUG=` +
`${process.env.CI_REPOSITORY_OWNER_SLUG}`); `${process.env.CI_REPOSITORY_OWNER_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REPOSITORY" not set. ' + core.info('Environment variable "GITHUB_REPOSITORY" not set. ' +
'Cannot set "CI_REPOSITORY_OWNER" and ' + 'Cannot set "CI_REPOSITORY_OWNER" and ' +
'"CI_REPOSITORY_OWNER_SLUG".'); '"CI_REPOSITORY_OWNER_SLUG".');
} }
@ -101,7 +100,7 @@ try {
core.info(`Set CI_REPOSITORY_NAME_SLUG=` + core.info(`Set CI_REPOSITORY_NAME_SLUG=` +
`${process.env.CI_REPOSITORY_NAME_SLUG}`); `${process.env.CI_REPOSITORY_NAME_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REPOSITORY" not set. ' + core.info('Environment variable "GITHUB_REPOSITORY" not set. ' +
'Cannot set "CI_REPOSITORY_NAME" and ' + 'Cannot set "CI_REPOSITORY_NAME" and ' +
'"CI_REPOSITORY_NAME_SLUG".'); '"CI_REPOSITORY_NAME_SLUG".');
} }
@ -116,7 +115,7 @@ try {
core.exportVariable('CI_REF_SLUG', slugify(ref)); core.exportVariable('CI_REF_SLUG', slugify(ref));
core.info(`Set CI_REF_SLUG=${process.env.CI_REF_SLUG}`); core.info(`Set CI_REF_SLUG=${process.env.CI_REF_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REF" not set. ' + core.info('Environment variable "GITHUB_REF" not set. ' +
'Cannot set "CI_REF_SLUG".'); 'Cannot set "CI_REF_SLUG".');
} }
@ -128,7 +127,7 @@ try {
core.exportVariable('CI_REF_NAME_SLUG', slugify(refName)); core.exportVariable('CI_REF_NAME_SLUG', slugify(refName));
core.info(`Set CI_REF_NAME_SLUG=${process.env.CI_REF_NAME_SLUG}`); core.info(`Set CI_REF_NAME_SLUG=${process.env.CI_REF_NAME_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REF" not set. ' + core.info('Environment variable "GITHUB_REF" not set. ' +
'Cannot set "CI_REF_NAME" and ' + 'Cannot set "CI_REF_NAME" and ' +
'"CI_REF_NAME_SLUG".'); '"CI_REF_NAME_SLUG".');
} }
@ -147,7 +146,7 @@ try {
core.info('Set CI_ACTION_REF_NAME_SLUG=' + core.info('Set CI_ACTION_REF_NAME_SLUG=' +
`${process.env.CI_ACTION_REF_NAME_SLUG}`); `${process.env.CI_ACTION_REF_NAME_SLUG}`);
} else { } else {
core.warning('Environment variables "GITHUB_REF" and ' + core.info('Environment variables "GITHUB_REF" and ' +
'"GITHUB_HEAD_REF" not set. ' + '"GITHUB_HEAD_REF" not set. ' +
'Cannot set "CI_ACTION_REF_NAME" and ' + 'Cannot set "CI_ACTION_REF_NAME" and ' +
'"CI_ACTION_REF_NAME_SLUG".'); '"CI_ACTION_REF_NAME_SLUG".');
@ -157,7 +156,7 @@ try {
core.exportVariable('CI_HEAD_REF_SLUG', slugify(headRef)); core.exportVariable('CI_HEAD_REF_SLUG', slugify(headRef));
core.info(`Set CI_HEAD_REF_SLUG=${process.env.CI_HEAD_REF_SLUG}`); core.info(`Set CI_HEAD_REF_SLUG=${process.env.CI_HEAD_REF_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_HEAD_REF" not set. ' + core.info('Environment variable "GITHUB_HEAD_REF" not set. ' +
'Cannot set "CI_HEAD_REF_SLUG".'); 'Cannot set "CI_HEAD_REF_SLUG".');
} }
@ -169,7 +168,7 @@ try {
core.exportVariable('CI_BASE_REF_SLUG', slugify(baseRef)); core.exportVariable('CI_BASE_REF_SLUG', slugify(baseRef));
core.info(`Set CI_BASE_REF_SLUG=${process.env.CI_BASE_REF_SLUG}`); core.info(`Set CI_BASE_REF_SLUG=${process.env.CI_BASE_REF_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_BASE_REF" not set. ' + core.info('Environment variable "GITHUB_BASE_REF" not set. ' +
'Cannot set "CI_BASE_REF_SLUG".'); 'Cannot set "CI_BASE_REF_SLUG".');
} }
@ -182,7 +181,7 @@ try {
core.exportVariable('CI_SHA_SHORT', getShaShort(sha)); core.exportVariable('CI_SHA_SHORT', getShaShort(sha));
core.info(`Set CI_SHA_SHORT=${process.env.CI_SHA_SHORT}`); core.info(`Set CI_SHA_SHORT=${process.env.CI_SHA_SHORT}`);
} else { } else {
core.warning('Environment variable "GITHUB_SHA" not set. ' + core.info('Environment variable "GITHUB_SHA" not set. ' +
'Cannot set "CI_SHA_SHORT".'); 'Cannot set "CI_SHA_SHORT".');
} }
@ -228,7 +227,7 @@ module.exports = {
/***/ }), /***/ }),
/***/ 351: /***/ 351:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
@ -240,8 +239,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const os = __importStar(__webpack_require__(87)); const os = __importStar(__nccwpck_require__(87));
const utils_1 = __webpack_require__(278); const utils_1 = __nccwpck_require__(278);
/** /**
* Commands * Commands
* *
@ -314,7 +313,7 @@ function escapeProperty(s) {
/***/ }), /***/ }),
/***/ 186: /***/ 186:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
@ -335,11 +334,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const command_1 = __webpack_require__(351); const command_1 = __nccwpck_require__(351);
const file_command_1 = __webpack_require__(717); const file_command_1 = __nccwpck_require__(717);
const utils_1 = __webpack_require__(278); const utils_1 = __nccwpck_require__(278);
const os = __importStar(__webpack_require__(87)); const os = __importStar(__nccwpck_require__(87));
const path = __importStar(__webpack_require__(622)); const path = __importStar(__nccwpck_require__(622));
/** /**
* The code to exit an action * The code to exit an action
*/ */
@ -423,6 +422,7 @@ exports.getInput = getInput;
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function setOutput(name, value) { function setOutput(name, value) {
process.stdout.write(os.EOL);
command_1.issueCommand('set-output', { name }, value); command_1.issueCommand('set-output', { name }, value);
} }
exports.setOutput = setOutput; exports.setOutput = setOutput;
@ -559,7 +559,7 @@ exports.getState = getState;
/***/ }), /***/ }),
/***/ 717: /***/ 717:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
@ -574,9 +574,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
// We use any as a valid input type // We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__webpack_require__(747)); const fs = __importStar(__nccwpck_require__(747));
const os = __importStar(__webpack_require__(87)); const os = __importStar(__nccwpck_require__(87));
const utils_1 = __webpack_require__(278); const utils_1 = __nccwpck_require__(278);
function issueCommand(command, message) { function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`]; const filePath = process.env[`GITHUB_${command}`];
if (!filePath) { if (!filePath) {
@ -650,10 +650,11 @@ module.exports = require("path");;
/******/ var __webpack_module_cache__ = {}; /******/ var __webpack_module_cache__ = {};
/******/ /******/
/******/ // The require function /******/ // The require function
/******/ function __webpack_require__(moduleId) { /******/ function __nccwpck_require__(moduleId) {
/******/ // Check if module is in cache /******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) { /******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ return __webpack_module_cache__[moduleId].exports; /******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ } /******/ }
/******/ // Create a new module (and put it into the cache) /******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = { /******/ var module = __webpack_module_cache__[moduleId] = {
@ -665,7 +666,7 @@ module.exports = require("path");;
/******/ // Execute the module function /******/ // Execute the module function
/******/ var threw = true; /******/ var threw = true;
/******/ try { /******/ try {
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
/******/ threw = false; /******/ threw = false;
/******/ } finally { /******/ } finally {
/******/ if(threw) delete __webpack_module_cache__[moduleId]; /******/ if(threw) delete __webpack_module_cache__[moduleId];
@ -678,10 +679,13 @@ module.exports = require("path");;
/************************************************************************/ /************************************************************************/
/******/ /* webpack/runtime/compat */ /******/ /* webpack/runtime/compat */
/******/ /******/
/******/ __webpack_require__.ab = __dirname + "/";/************************************************************************/ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
/******/ // module exports must be returned from runtime so entry inlining is disabled /******/
/******/ // startup /******/ // startup
/******/ // Load entry module and return exports /******/ // Load entry module and return exports
/******/ return __webpack_require__(932); /******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __nccwpck_require__(932);
/******/ module.exports = __webpack_exports__;
/******/
/******/ })() /******/ })()
; ;

View file

@ -63,7 +63,7 @@ try {
core.info(`Set CI_REPOSITORY_SLUG=` + core.info(`Set CI_REPOSITORY_SLUG=` +
`${process.env.CI_REPOSITORY_SLUG}`); `${process.env.CI_REPOSITORY_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REPOSITORY" not set. ' + core.info('Environment variable "GITHUB_REPOSITORY" not set. ' +
'Cannot set "CI_REPOSITORY_SLUG".'); 'Cannot set "CI_REPOSITORY_SLUG".');
} }
@ -78,7 +78,7 @@ try {
core.info(`Set CI_REPOSITORY_OWNER_SLUG=` + core.info(`Set CI_REPOSITORY_OWNER_SLUG=` +
`${process.env.CI_REPOSITORY_OWNER_SLUG}`); `${process.env.CI_REPOSITORY_OWNER_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REPOSITORY" not set. ' + core.info('Environment variable "GITHUB_REPOSITORY" not set. ' +
'Cannot set "CI_REPOSITORY_OWNER" and ' + 'Cannot set "CI_REPOSITORY_OWNER" and ' +
'"CI_REPOSITORY_OWNER_SLUG".'); '"CI_REPOSITORY_OWNER_SLUG".');
} }
@ -94,7 +94,7 @@ try {
core.info(`Set CI_REPOSITORY_NAME_SLUG=` + core.info(`Set CI_REPOSITORY_NAME_SLUG=` +
`${process.env.CI_REPOSITORY_NAME_SLUG}`); `${process.env.CI_REPOSITORY_NAME_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REPOSITORY" not set. ' + core.info('Environment variable "GITHUB_REPOSITORY" not set. ' +
'Cannot set "CI_REPOSITORY_NAME" and ' + 'Cannot set "CI_REPOSITORY_NAME" and ' +
'"CI_REPOSITORY_NAME_SLUG".'); '"CI_REPOSITORY_NAME_SLUG".');
} }
@ -109,7 +109,7 @@ try {
core.exportVariable('CI_REF_SLUG', slugify(ref)); core.exportVariable('CI_REF_SLUG', slugify(ref));
core.info(`Set CI_REF_SLUG=${process.env.CI_REF_SLUG}`); core.info(`Set CI_REF_SLUG=${process.env.CI_REF_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REF" not set. ' + core.info('Environment variable "GITHUB_REF" not set. ' +
'Cannot set "CI_REF_SLUG".'); 'Cannot set "CI_REF_SLUG".');
} }
@ -121,7 +121,7 @@ try {
core.exportVariable('CI_REF_NAME_SLUG', slugify(refName)); core.exportVariable('CI_REF_NAME_SLUG', slugify(refName));
core.info(`Set CI_REF_NAME_SLUG=${process.env.CI_REF_NAME_SLUG}`); core.info(`Set CI_REF_NAME_SLUG=${process.env.CI_REF_NAME_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_REF" not set. ' + core.info('Environment variable "GITHUB_REF" not set. ' +
'Cannot set "CI_REF_NAME" and ' + 'Cannot set "CI_REF_NAME" and ' +
'"CI_REF_NAME_SLUG".'); '"CI_REF_NAME_SLUG".');
} }
@ -140,7 +140,7 @@ try {
core.info('Set CI_ACTION_REF_NAME_SLUG=' + core.info('Set CI_ACTION_REF_NAME_SLUG=' +
`${process.env.CI_ACTION_REF_NAME_SLUG}`); `${process.env.CI_ACTION_REF_NAME_SLUG}`);
} else { } else {
core.warning('Environment variables "GITHUB_REF" and ' + core.info('Environment variables "GITHUB_REF" and ' +
'"GITHUB_HEAD_REF" not set. ' + '"GITHUB_HEAD_REF" not set. ' +
'Cannot set "CI_ACTION_REF_NAME" and ' + 'Cannot set "CI_ACTION_REF_NAME" and ' +
'"CI_ACTION_REF_NAME_SLUG".'); '"CI_ACTION_REF_NAME_SLUG".');
@ -150,7 +150,7 @@ try {
core.exportVariable('CI_HEAD_REF_SLUG', slugify(headRef)); core.exportVariable('CI_HEAD_REF_SLUG', slugify(headRef));
core.info(`Set CI_HEAD_REF_SLUG=${process.env.CI_HEAD_REF_SLUG}`); core.info(`Set CI_HEAD_REF_SLUG=${process.env.CI_HEAD_REF_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_HEAD_REF" not set. ' + core.info('Environment variable "GITHUB_HEAD_REF" not set. ' +
'Cannot set "CI_HEAD_REF_SLUG".'); 'Cannot set "CI_HEAD_REF_SLUG".');
} }
@ -162,7 +162,7 @@ try {
core.exportVariable('CI_BASE_REF_SLUG', slugify(baseRef)); core.exportVariable('CI_BASE_REF_SLUG', slugify(baseRef));
core.info(`Set CI_BASE_REF_SLUG=${process.env.CI_BASE_REF_SLUG}`); core.info(`Set CI_BASE_REF_SLUG=${process.env.CI_BASE_REF_SLUG}`);
} else { } else {
core.warning('Environment variable "GITHUB_BASE_REF" not set. ' + core.info('Environment variable "GITHUB_BASE_REF" not set. ' +
'Cannot set "CI_BASE_REF_SLUG".'); 'Cannot set "CI_BASE_REF_SLUG".');
} }
@ -175,7 +175,7 @@ try {
core.exportVariable('CI_SHA_SHORT', getShaShort(sha)); core.exportVariable('CI_SHA_SHORT', getShaShort(sha));
core.info(`Set CI_SHA_SHORT=${process.env.CI_SHA_SHORT}`); core.info(`Set CI_SHA_SHORT=${process.env.CI_SHA_SHORT}`);
} else { } else {
core.warning('Environment variable "GITHUB_SHA" not set. ' + core.info('Environment variable "GITHUB_SHA" not set. ' +
'Cannot set "CI_SHA_SHORT".'); 'Cannot set "CI_SHA_SHORT".');
} }

6907
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "github-env-vars-action", "name": "github-env-vars-action",
"version": "2.1.0", "version": "2.2.0",
"description": "A GitHub Action to expose useful environment variables.", "description": "A GitHub Action to expose useful environment variables.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -23,11 +23,11 @@
}, },
"homepage": "https://github.com/FranzDiebold/github-env-vars-action#readme", "homepage": "https://github.com/FranzDiebold/github-env-vars-action#readme",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6" "@actions/core": "^1.2.7"
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.25.1", "@vercel/ncc": "^0.28.4",
"eslint": "^7.14.0", "eslint": "^7.25.0",
"eslint-config-google": "^0.14.0", "eslint-config-google": "^0.14.0",
"jest": "^26.6.3" "jest": "^26.6.3"
} }