14 Commits

Author SHA1 Message Date
Peter Evans
4b076256d2 Merge pull request #33 from jennydaman/lowercase
Some checks failed
Publish Docker Image / publish (push) Has been cancelled
Convert repository to lower case
2021-02-05 10:18:20 +09:00
Jennings Zhang
d4e0800ec5 Convert repository to lower case 2021-02-03 19:58:54 -05:00
Peter Evans
91342cc8a6 Merge pull request #30 from peter-evans/update-distribution
Update distribution
2020-12-28 10:15:06 +09:00
peter-evans
6443116500 build: update distribution 2020-12-28 01:06:26 +00:00
Peter Evans
445b7e95b6 Merge pull request #21 from peter-evans/update-dependencies
Update dependencies
2020-12-28 10:05:23 +09:00
actions-bot
cdce24d19d chore: update dependencies 2020-12-24 02:02:44 +00:00
Peter Evans
dc17467ac6 Merge pull request #25 from peter-evans/dependabot/npm_and_yarn/node-notifier-8.0.1
Bump node-notifier from 8.0.0 to 8.0.1
2020-12-23 09:46:03 +09:00
dependabot[bot]
4b080f0994 Bump node-notifier from 8.0.0 to 8.0.1
Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/mikaelbr/node-notifier/releases)
- [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md)
- [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-23 00:16:38 +00:00
Peter Evans
1d0dd5623c Merge pull request #23 from peter-evans/fix-error-handling
Some checks failed
Publish Docker Image / publish (push) Has been cancelled
fix: throw errors on request failure
2020-10-27 10:44:08 +09:00
Peter Evans
8dd2813668 fix: throw errors on request failure 2020-10-27 10:41:21 +09:00
Peter Evans
dac62d382a Merge pull request #20 from peter-evans/update-distribution
Update distribution
2020-10-02 15:49:36 +09:00
peter-evans
c4ad60f25c build: update distribution 2020-10-02 06:49:03 +00:00
Peter Evans
3cf73e9a56 Merge pull request #19 from peter-evans/dependabot/npm_and_yarn/actions/core-1.2.6
Bump @actions/core from 1.2.5 to 1.2.6
2020-10-02 15:47:55 +09:00
dependabot[bot]
227aa80eb9 Bump @actions/core from 1.2.5 to 1.2.6
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-02 06:32:40 +00:00
5 changed files with 788 additions and 2050 deletions

127
dist/index.js vendored
View File

@@ -72,6 +72,10 @@ function updateRepositoryDescription(token, repository, description, fullDescrip
'Content-Type': 'application/json',
Authorization: `JWT ${token}`
}
}).then(res => {
if (!res.ok) {
throw new Error(res.statusText);
}
});
});
}
@@ -148,6 +152,8 @@ function getInputs() {
if (!inputs.repository && process.env['GITHUB_REPOSITORY']) {
inputs.repository = process.env['GITHUB_REPOSITORY'];
}
// Docker repositories must be all lower case
inputs.repository = inputs.repository.toLowerCase();
return inputs;
}
exports.getInputs = getInputs;
@@ -252,6 +258,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(278);
/**
* Commands
*
@@ -305,28 +312,14 @@ class Command {
return cmdStr;
}
}
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
function escapeData(s) {
return toCommandValue(s)
return utils_1.toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A');
}
function escapeProperty(s) {
return toCommandValue(s)
return utils_1.toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A')
@@ -360,6 +353,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const command_1 = __webpack_require__(351);
const file_command_1 = __webpack_require__(717);
const utils_1 = __webpack_require__(278);
const os = __importStar(__webpack_require__(87));
const path = __importStar(__webpack_require__(622));
/**
@@ -386,9 +381,17 @@ var ExitCode;
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function exportVariable(name, val) {
const convertedVal = command_1.toCommandValue(val);
const convertedVal = utils_1.toCommandValue(val);
process.env[name] = convertedVal;
command_1.issueCommand('set-env', { name }, convertedVal);
const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) {
const delimiter = '_GitHubActionsFileCommandDelimeter_';
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
file_command_1.issueCommand('ENV', commandValue);
}
else {
command_1.issueCommand('set-env', { name }, convertedVal);
}
}
exports.exportVariable = exportVariable;
/**
@@ -404,7 +407,13 @@ exports.setSecret = setSecret;
* @param inputPath
*/
function addPath(inputPath) {
command_1.issueCommand('add-path', {}, inputPath);
const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) {
file_command_1.issueCommand('PATH', inputPath);
}
else {
command_1.issueCommand('add-path', {}, inputPath);
}
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
exports.addPath = addPath;
@@ -566,6 +575,68 @@ exports.getState = getState;
/***/ }),
/***/ 717:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
// For internal use, subject to change.
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__webpack_require__(747));
const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(278);
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
}
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
exports.issueCommand = issueCommand;
//# sourceMappingURL=file-command.js.map
/***/ }),
/***/ 278:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", ({ value: true }));
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
//# sourceMappingURL=utils.js.map
/***/ }),
/***/ 467:
/***/ ((module, exports, __webpack_require__) => {
@@ -2235,7 +2306,7 @@ module.exports = eval("require")("encoding");
/***/ ((module) => {
"use strict";
module.exports = require("fs");
module.exports = require("fs");;
/***/ }),
@@ -2243,7 +2314,7 @@ module.exports = require("fs");
/***/ ((module) => {
"use strict";
module.exports = require("http");
module.exports = require("http");;
/***/ }),
@@ -2251,7 +2322,7 @@ module.exports = require("http");
/***/ ((module) => {
"use strict";
module.exports = require("https");
module.exports = require("https");;
/***/ }),
@@ -2259,7 +2330,7 @@ module.exports = require("https");
/***/ ((module) => {
"use strict";
module.exports = require("os");
module.exports = require("os");;
/***/ }),
@@ -2267,7 +2338,7 @@ module.exports = require("os");
/***/ ((module) => {
"use strict";
module.exports = require("path");
module.exports = require("path");;
/***/ }),
@@ -2275,7 +2346,7 @@ module.exports = require("path");
/***/ ((module) => {
"use strict";
module.exports = require("stream");
module.exports = require("stream");;
/***/ }),
@@ -2283,7 +2354,7 @@ module.exports = require("stream");
/***/ ((module) => {
"use strict";
module.exports = require("url");
module.exports = require("url");;
/***/ }),
@@ -2291,7 +2362,7 @@ module.exports = require("url");
/***/ ((module) => {
"use strict";
module.exports = require("util");
module.exports = require("util");;
/***/ }),
@@ -2299,7 +2370,7 @@ module.exports = require("util");
/***/ ((module) => {
"use strict";
module.exports = require("zlib");
module.exports = require("zlib");;
/***/ })

2678
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -27,22 +27,22 @@
},
"homepage": "https://github.com/peter-evans/dockerhub-description#readme",
"dependencies": {
"@actions/core": "1.2.5",
"@actions/core": "1.2.6",
"node-fetch": "2.6.1"
},
"devDependencies": {
"@types/jest": "26.0.14",
"@types/node": "14.10.3",
"@typescript-eslint/parser": "4.1.1",
"@vercel/ncc": "0.24.1",
"eslint": "7.9.0",
"@types/jest": "26.0.19",
"@types/node": "14.14.16",
"@typescript-eslint/parser": "4.11.0",
"@vercel/ncc": "0.26.1",
"eslint": "7.16.0",
"eslint-plugin-github": "4.1.1",
"eslint-plugin-jest": "24.0.1",
"jest": "26.4.2",
"jest-circus": "26.4.2",
"js-yaml": "3.14.0",
"prettier": "2.1.2",
"ts-jest": "26.3.0",
"typescript": "4.0.2"
"eslint-plugin-jest": "24.1.3",
"jest": "26.6.3",
"jest-circus": "26.6.3",
"js-yaml": "3.14.1",
"prettier": "2.2.1",
"ts-jest": "26.4.4",
"typescript": "4.1.3"
}
}

View File

@@ -40,5 +40,9 @@ export async function updateRepositoryDescription(
'Content-Type': 'application/json',
Authorization: `JWT ${token}`
}
}).then(res => {
if (!res.ok) {
throw new Error(res.statusText)
}
})
}

View File

@@ -58,6 +58,9 @@ export function getInputs(): Inputs {
inputs.repository = process.env['GITHUB_REPOSITORY']
}
// Docker repositories must be all lower case
inputs.repository = inputs.repository.toLowerCase()
return inputs
}