Skip to content

Commit

Permalink
[gha] Handle missing fields in hyperjump labels
Browse files Browse the repository at this point in the history
Apparently GHA auto-removes empty inputs so even though they are specified
they don't make it to the action. To work around this we make the fields
optional and handle the case where they are empty.

Closes: diem#5412
Approved by: bmwill
  • Loading branch information
metajack authored and bors-libra committed Jul 31, 2020
1 parent 9e2d923 commit bb3224a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/actions/hyperjump-labels/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ inputs:
required: true
add:
description: label strings to add
required: true
required: false
remove:
description: label strings to remove
required: true
required: false
runs:
using: 'node12'
main: 'dist/index.js'
4 changes: 2 additions & 2 deletions .github/actions/hyperjump-labels/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ async function main() {
try {
const github_token = core.getInput("github-token", {required: true});
const number = core.getInput("number", {required: true});
const add_labels = core.getInput("add", {required: true});
const remove_labels = core.getInput("remove", {required: true});
const add_labels = core.getInput("add", {required: false});
const remove_labels = core.getInput("remove", {required: false});

if (!add_labels && !remove_labels) {
core.warning("add and remove fields both empty");
Expand Down
11 changes: 0 additions & 11 deletions .github/actions/labels/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/actions/labels/dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit bb3224a

Please sign in to comment.