Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
616d1b63e8 | ||
|
|
76c5a90afd | ||
|
|
ae9aa33b7a | ||
|
|
54a7a303dd | ||
|
|
73ac163f37 | ||
|
|
582deb1a76 | ||
|
|
af2d781270 | ||
|
|
c9ab1334ce | ||
|
|
acbe71233a | ||
|
|
9c6c243f1d | ||
|
|
789f11f261 | ||
|
|
b45eba2bbb | ||
|
|
95dee52e1c | ||
|
|
041efd9199 | ||
|
|
f7242b77a5 | ||
|
|
da75b33366 | ||
|
|
7dedddda13 | ||
|
|
bc29825a35 | ||
|
|
9aa16a4f71 | ||
|
|
a5a2b94bf3 | ||
|
|
fe4fd29897 | ||
|
|
1087364d83 | ||
|
|
e9afc858d8 | ||
|
|
97e5f46ce8 | ||
|
|
9627b85954 | ||
|
|
78d978464e | ||
|
|
71b8c97334 | ||
|
|
773f327409 |
@@ -9,8 +9,7 @@
|
|||||||
"plugin:import/errors",
|
"plugin:import/errors",
|
||||||
"plugin:import/warnings",
|
"plugin:import/warnings",
|
||||||
"plugin:import/typescript",
|
"plugin:import/typescript",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended"
|
||||||
"prettier/@typescript-eslint"
|
|
||||||
],
|
],
|
||||||
"plugins": ["@typescript-eslint"],
|
"plugins": ["@typescript-eslint"],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
|||||||
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -1,12 +1,12 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches: [main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
DOCKERHUB_REPOSITORY: peterevans/dd-ci-fixture-${{ matrix.target }}
|
DOCKERHUB_REPOSITORY: peterevans/dd-ci-fixture-${{ matrix.target }}
|
||||||
|
|
||||||
package:
|
package:
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
needs: [test]
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
commit-message: 'build: update distribution'
|
commit-message: 'build: update distribution'
|
||||||
title: Update distribution
|
title: Update distribution
|
||||||
body: |
|
body: |
|
||||||
- Updates the distribution for changes on `master`
|
- Updates the distribution for changes on `main`
|
||||||
|
|
||||||
Auto-generated by [create-pull-request][1]
|
Auto-generated by [create-pull-request][1]
|
||||||
|
|
||||||
|
|||||||
5
.github/workflows/dockerhub-description.yml
vendored
5
.github/workflows/dockerhub-description.yml
vendored
@@ -3,7 +3,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- README.md
|
- README.md
|
||||||
- .github/workflows/dockerhub-description.yml
|
- .github/workflows/dockerhub-description.yml
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
- name: Modify readme for DockerHub
|
- name: Modify readme for DockerHub
|
||||||
run: |
|
run: |
|
||||||
sed -i 's/# Docker Hub Description/# [Docker Hub Description](https:\/\/github.com\/peter-evans\/dockerhub-description)/' README.md
|
sed -i 's/# Docker Hub Description/# [Docker Hub Description](https:\/\/github.com\/peter-evans\/dockerhub-description)/' README.md
|
||||||
sed -i 's/(LICENSE)/(https:\/\/github.com\/peter-evans\/dockerhub-description\/blob\/master\/LICENSE)/' README.md
|
sed -i 's/(LICENSE)/(https:\/\/github.com\/peter-evans\/dockerhub-description\/blob\/main\/LICENSE)/' README.md
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -24,3 +24,4 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
repository: peterevans/dockerhub-description
|
repository: peterevans/dockerhub-description
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
|
|||||||
4
.github/workflows/publish-docker.yml
vendored
4
.github/workflows/publish-docker.yml
vendored
@@ -2,7 +2,7 @@ name: Publish Docker Image
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
env:
|
env:
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||||
|
|
||||||
# Use Docker `latest` tag convention
|
# Use Docker `latest` tag convention
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest
|
[ "$VERSION" == "main" ] && VERSION=latest
|
||||||
|
|
||||||
# Build and tag image
|
# Build and tag image
|
||||||
docker build . --file Dockerfile --tag $IMAGE_NAME --label "org.opencontainers.image.version=$VERSION"
|
docker build . --file Dockerfile --tag $IMAGE_NAME --label "org.opencontainers.image.version=$VERSION"
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -43,16 +43,30 @@ If this is not the case the path can be specified with the `readme-filepath` inp
|
|||||||
readme-filepath: ./path/to/README.md
|
readme-filepath: ./path/to/README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Using the GitHub repository description
|
||||||
|
|
||||||
|
The GitHub repository description can be used for the Docker Hub `short-descripton` by passing the description from the event context.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
- name: Docker Hub Description
|
||||||
|
uses: peter-evans/dockerhub-description@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
repository: peterevans/dockerhub-description
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
The following workflow updates the Docker Hub repository description whenever there are changes to `README.md` and the workflow file itself on the `master` branch. This workflow assumes its location to be `.github/workflows/dockerhub-description.yml`.
|
The following workflow updates the Docker Hub repository description whenever there are changes to `README.md` and the workflow file itself on the `main` branch. This workflow assumes its location to be `.github/workflows/dockerhub-description.yml`.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
name: Update Docker Hub Description
|
name: Update Docker Hub Description
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- README.md
|
- README.md
|
||||||
- .github/workflows/dockerhub-description.yml
|
- .github/workflows/dockerhub-description.yml
|
||||||
@@ -68,6 +82,7 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
repository: peterevans/dockerhub-description
|
repository: peterevans/dockerhub-description
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
```
|
```
|
||||||
|
|
||||||
Updates the Docker Hub repository description whenever a new release is created.
|
Updates the Docker Hub repository description whenever a new release is created.
|
||||||
@@ -87,6 +102,7 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
repository: peterevans/dockerhub-description
|
repository: peterevans/dockerhub-description
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using the Docker image independently of GitHub Actions
|
## Using the Docker image independently of GitHub Actions
|
||||||
|
|||||||
176
dist/index.js
vendored
176
dist/index.js
vendored
@@ -1,9 +1,8 @@
|
|||||||
module.exports =
|
|
||||||
/******/ (() => { // webpackBootstrap
|
/******/ (() => { // webpackBootstrap
|
||||||
/******/ var __webpack_modules__ = ({
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
/***/ 812:
|
/***/ 812:
|
||||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -37,8 +36,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.updateRepositoryDescription = exports.getToken = void 0;
|
exports.updateRepositoryDescription = exports.getToken = void 0;
|
||||||
const core = __importStar(__webpack_require__(186));
|
const core = __importStar(__nccwpck_require__(186));
|
||||||
const fetch = __importStar(__webpack_require__(467));
|
const fetch = __importStar(__nccwpck_require__(467));
|
||||||
const DESCRIPTION_MAX_CHARS = 100;
|
const DESCRIPTION_MAX_CHARS = 100;
|
||||||
function getToken(username, password) {
|
function getToken(username, password) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
@@ -51,6 +50,9 @@ function getToken(username, password) {
|
|||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
headers: { 'Content-Type': 'application/json' }
|
headers: { 'Content-Type': 'application/json' }
|
||||||
});
|
});
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`Unexpected response: ${response.status} ${response.statusText}`);
|
||||||
|
}
|
||||||
const json = yield response.json();
|
const json = yield response.json();
|
||||||
core.setSecret(json['token']);
|
core.setSecret(json['token']);
|
||||||
return json['token'];
|
return json['token'];
|
||||||
@@ -85,7 +87,7 @@ exports.updateRepositoryDescription = updateRepositoryDescription;
|
|||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 480:
|
/***/ 480:
|
||||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -110,7 +112,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.validateInputs = exports.getInputs = void 0;
|
exports.validateInputs = exports.getInputs = void 0;
|
||||||
const core = __importStar(__webpack_require__(186));
|
const core = __importStar(__nccwpck_require__(186));
|
||||||
const README_FILEPATH_DEFAULT = './README.md';
|
const README_FILEPATH_DEFAULT = './README.md';
|
||||||
function getInputs() {
|
function getInputs() {
|
||||||
const inputs = {
|
const inputs = {
|
||||||
@@ -172,7 +174,7 @@ exports.validateInputs = validateInputs;
|
|||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 109:
|
/***/ 109:
|
||||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -205,11 +207,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const core = __importStar(__webpack_require__(186));
|
const core = __importStar(__nccwpck_require__(186));
|
||||||
const inputHelper = __importStar(__webpack_require__(480));
|
const inputHelper = __importStar(__nccwpck_require__(480));
|
||||||
const dockerhubHelper = __importStar(__webpack_require__(812));
|
const dockerhubHelper = __importStar(__nccwpck_require__(812));
|
||||||
const fs = __importStar(__webpack_require__(747));
|
const fs = __importStar(__nccwpck_require__(747));
|
||||||
const util_1 = __webpack_require__(669);
|
const util_1 = __nccwpck_require__(669);
|
||||||
const MAX_BYTES = 25000;
|
const MAX_BYTES = 25000;
|
||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
@@ -245,20 +247,33 @@ run();
|
|||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 351:
|
/***/ 351:
|
||||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
result["default"] = mod;
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const os = __importStar(__webpack_require__(87));
|
exports.issue = exports.issueCommand = void 0;
|
||||||
const utils_1 = __webpack_require__(278);
|
const os = __importStar(__nccwpck_require__(87));
|
||||||
|
const utils_1 = __nccwpck_require__(278);
|
||||||
/**
|
/**
|
||||||
* Commands
|
* Commands
|
||||||
*
|
*
|
||||||
@@ -331,10 +346,29 @@ function escapeProperty(s) {
|
|||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 186:
|
/***/ 186:
|
||||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
@@ -344,19 +378,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
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 }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const command_1 = __webpack_require__(351);
|
exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
||||||
const file_command_1 = __webpack_require__(717);
|
const command_1 = __nccwpck_require__(351);
|
||||||
const utils_1 = __webpack_require__(278);
|
const file_command_1 = __nccwpck_require__(717);
|
||||||
const os = __importStar(__webpack_require__(87));
|
const utils_1 = __nccwpck_require__(278);
|
||||||
const path = __importStar(__webpack_require__(622));
|
const os = __importStar(__nccwpck_require__(87));
|
||||||
|
const path = __importStar(__nccwpck_require__(622));
|
||||||
/**
|
/**
|
||||||
* The code to exit an action
|
* The code to exit an action
|
||||||
*/
|
*/
|
||||||
@@ -418,7 +446,9 @@ function addPath(inputPath) {
|
|||||||
}
|
}
|
||||||
exports.addPath = addPath;
|
exports.addPath = addPath;
|
||||||
/**
|
/**
|
||||||
* Gets the value of an input. The value is also trimmed.
|
* Gets the value of an input.
|
||||||
|
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
|
||||||
|
* Returns an empty string if the value is not defined.
|
||||||
*
|
*
|
||||||
* @param name name of the input to get
|
* @param name name of the input to get
|
||||||
* @param options optional. See InputOptions.
|
* @param options optional. See InputOptions.
|
||||||
@@ -429,9 +459,34 @@ function getInput(name, options) {
|
|||||||
if (options && options.required && !val) {
|
if (options && options.required && !val) {
|
||||||
throw new Error(`Input required and not supplied: ${name}`);
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
}
|
}
|
||||||
|
if (options && options.trimWhitespace === false) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
return val.trim();
|
return val.trim();
|
||||||
}
|
}
|
||||||
exports.getInput = getInput;
|
exports.getInput = getInput;
|
||||||
|
/**
|
||||||
|
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
|
||||||
|
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
|
||||||
|
* The return value is also in boolean type.
|
||||||
|
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns boolean
|
||||||
|
*/
|
||||||
|
function getBooleanInput(name, options) {
|
||||||
|
const trueValue = ['true', 'True', 'TRUE'];
|
||||||
|
const falseValue = ['false', 'False', 'FALSE'];
|
||||||
|
const val = getInput(name, options);
|
||||||
|
if (trueValue.includes(val))
|
||||||
|
return true;
|
||||||
|
if (falseValue.includes(val))
|
||||||
|
return false;
|
||||||
|
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
|
||||||
|
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
||||||
|
}
|
||||||
|
exports.getBooleanInput = getBooleanInput;
|
||||||
/**
|
/**
|
||||||
* Sets the value of an output.
|
* Sets the value of an output.
|
||||||
*
|
*
|
||||||
@@ -440,6 +495,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;
|
||||||
@@ -576,24 +632,37 @@ exports.getState = getState;
|
|||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 717:
|
/***/ 717:
|
||||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// For internal use, subject to change.
|
// For internal use, subject to change.
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
if (mod && mod.__esModule) return mod;
|
if (mod && mod.__esModule) return mod;
|
||||||
var result = {};
|
var result = {};
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
result["default"] = mod;
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.issueCommand = void 0;
|
||||||
// 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) {
|
||||||
@@ -619,6 +688,7 @@ exports.issueCommand = issueCommand;
|
|||||||
// 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 */
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.toCommandValue = void 0;
|
||||||
/**
|
/**
|
||||||
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
||||||
* @param input input to sanitize into a string
|
* @param input input to sanitize into a string
|
||||||
@@ -638,7 +708,7 @@ exports.toCommandValue = toCommandValue;
|
|||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 467:
|
/***/ 467:
|
||||||
/***/ ((module, exports, __webpack_require__) => {
|
/***/ ((module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -647,11 +717,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||||||
|
|
||||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||||
|
|
||||||
var Stream = _interopDefault(__webpack_require__(413));
|
var Stream = _interopDefault(__nccwpck_require__(413));
|
||||||
var http = _interopDefault(__webpack_require__(605));
|
var http = _interopDefault(__nccwpck_require__(605));
|
||||||
var Url = _interopDefault(__webpack_require__(835));
|
var Url = _interopDefault(__nccwpck_require__(835));
|
||||||
var https = _interopDefault(__webpack_require__(211));
|
var https = _interopDefault(__nccwpck_require__(211));
|
||||||
var zlib = _interopDefault(__webpack_require__(761));
|
var zlib = _interopDefault(__nccwpck_require__(761));
|
||||||
|
|
||||||
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
|
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
|
||||||
|
|
||||||
@@ -802,7 +872,7 @@ FetchError.prototype.name = 'FetchError';
|
|||||||
|
|
||||||
let convert;
|
let convert;
|
||||||
try {
|
try {
|
||||||
convert = __webpack_require__(877).convert;
|
convert = __nccwpck_require__(877).convert;
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
const INTERNALS = Symbol('Body internals');
|
const INTERNALS = Symbol('Body internals');
|
||||||
@@ -2380,10 +2450,11 @@ module.exports = require("zlib");;
|
|||||||
/******/ 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] = {
|
||||||
@@ -2395,7 +2466,7 @@ module.exports = require("zlib");;
|
|||||||
/******/ // 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];
|
||||||
@@ -2408,10 +2479,13 @@ module.exports = require("zlib");;
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/******/ /* 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__(109);
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||||
|
/******/ var __webpack_exports__ = __nccwpck_require__(109);
|
||||||
|
/******/ module.exports = __webpack_exports__;
|
||||||
|
/******/
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
12772
package-lock.json
generated
12772
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@@ -27,22 +27,22 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/peter-evans/dockerhub-description#readme",
|
"homepage": "https://github.com/peter-evans/dockerhub-description#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "1.2.6",
|
"@actions/core": "1.3.0",
|
||||||
"node-fetch": "2.6.1"
|
"node-fetch": "2.6.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "26.0.19",
|
"@types/jest": "26.0.23",
|
||||||
"@types/node": "14.14.16",
|
"@types/node": "15.6.1",
|
||||||
"@typescript-eslint/parser": "4.11.0",
|
"@typescript-eslint/parser": "4.25.0",
|
||||||
"@vercel/ncc": "0.26.1",
|
"@vercel/ncc": "0.28.6",
|
||||||
"eslint": "7.16.0",
|
"eslint": "7.27.0",
|
||||||
"eslint-plugin-github": "4.1.1",
|
"eslint-plugin-github": "4.1.3",
|
||||||
"eslint-plugin-jest": "24.1.3",
|
"eslint-plugin-jest": "24.3.6",
|
||||||
"jest": "26.6.3",
|
"jest": "27.0.1",
|
||||||
"jest-circus": "26.6.3",
|
"jest-circus": "27.0.1",
|
||||||
"js-yaml": "3.14.1",
|
"js-yaml": "4.1.0",
|
||||||
"prettier": "2.2.1",
|
"prettier": "2.3.0",
|
||||||
"ts-jest": "26.4.4",
|
"ts-jest": "27.0.1",
|
||||||
"typescript": "4.1.3"
|
"typescript": "4.3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ export async function getToken(
|
|||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
headers: {'Content-Type': 'application/json'}
|
headers: {'Content-Type': 'application/json'}
|
||||||
})
|
})
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(
|
||||||
|
`Unexpected response: ${response.status} ${response.statusText}`
|
||||||
|
)
|
||||||
|
}
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
core.setSecret(json['token'])
|
core.setSecret(json['token'])
|
||||||
return json['token']
|
return json['token']
|
||||||
|
|||||||
Reference in New Issue
Block a user