Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 11dbf21

Browse files
committed
Attempt fix for buildArg input
README.md | 2 +- action.yml | 2 +- dist/index.js | 14 +++++++------- index.js | 14 +++++++------- 4 files changed, 16 insertions(+), 16 deletions(-)
1 parent a12ec4b commit 11dbf21

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Build and publish your repository as a Docker image and push it to GitHub Packag
3636

3737
*Optional*. Added to the end of the tag. Useful if you want to let *GitHub Docker* decide the tag, but append something of your own to it.
3838

39-
### `buildArguments`
39+
### `buildArgs`
4040

4141
*Optional*. Any additional build arguments to use when building the image.
4242

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ inputs:
2626
imageTagSuffix:
2727
description: "Added to the end of the tag."
2828
required: false
29-
buildArguments:
29+
buildArgs:
3030
description: "The build arguments for image."
3131
required: false
3232
outputs:

dist/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,12 +1004,12 @@ async function run() {
10041004
const ref = process.env['GITHUB_REF'];
10051005
const refArray = ref.split('/');
10061006
if (!imageTag) {
1007-
const refLast = refArray[refArray.length - 1];
1008-
if (refLast === "merge" && refArray.length >= 2) {
1009-
imageTag = "mr" + refArray[refArray.length - 2];
1010-
} else {
1011-
imageTag = refLast;
1012-
}
1007+
const refLast = refArray[refArray.length - 1];
1008+
if (refLast === "merge" && refArray.length >= 2) {
1009+
imageTag = "mr" + refArray[refArray.length - 2];
1010+
} else {
1011+
imageTag = refLast;
1012+
}
10131013
}
10141014
let imageTagPrefix = core.getInput('imageTagPrefix', { required: false });
10151015
if (imageTagPrefix) imageTag = imageTagPrefix + imageTag;
@@ -1019,7 +1019,7 @@ async function run() {
10191019
// Process the build args
10201020
let buildArg = [];
10211021
const buildArgsRaw = core.getInput('buildArg', { require: false });
1022-
if (buildArgsRaw) buildArg = buildArgsRaw.match(/(\\.|[^&])+/g).flatMap(str => ["--build-arg", str]);
1022+
if (buildArgsRaw) buildArg = buildArgsRaw.match(/\w+=\S+/g).flatMap(str => ["--build-arg", str]);
10231023

10241024
// Set some variables.
10251025
const imageURL = `docker.pkg.github.com/${repository}/${imageName}:${imageTag}`

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ async function run() {
5858
const ref = process.env['GITHUB_REF'];
5959
const refArray = ref.split('/');
6060
if (!imageTag) {
61-
const refLast = refArray[refArray.length - 1];
62-
if (refLast === "merge" && refArray.length >= 2) {
63-
imageTag = "mr" + refArray[refArray.length - 2];
64-
} else {
65-
imageTag = refLast;
66-
}
61+
const refLast = refArray[refArray.length - 1];
62+
if (refLast === "merge" && refArray.length >= 2) {
63+
imageTag = "mr" + refArray[refArray.length - 2];
64+
} else {
65+
imageTag = refLast;
66+
}
6767
}
6868
let imageTagPrefix = core.getInput('imageTagPrefix', { required: false });
6969
if (imageTagPrefix) imageTag = imageTagPrefix + imageTag;
@@ -73,7 +73,7 @@ async function run() {
7373
// Process the build args
7474
let buildArg = [];
7575
const buildArgsRaw = core.getInput('buildArg', { require: false });
76-
if (buildArgsRaw) buildArg = buildArgsRaw.match(/(\\.|[^&])+/g).flatMap(str => ["--build-arg", str]);
76+
if (buildArgsRaw) buildArg = buildArgsRaw.match(/\w+=\S+/g).flatMap(str => ["--build-arg", str]);
7777

7878
// Set some variables.
7979
const imageURL = `docker.pkg.github.com/${repository}/${imageName}:${imageTag}`

0 commit comments

Comments
 (0)