Skip to content

Usability improvement for input of generic workflow #165

@laurentsimon

Description

@laurentsimon

The current input needs:

set -euo pipefail
DIGEST=$(sha256sum binary-linux-amd64)
DIGEST="${DIGEST//'%'/'%25'}"
DIGEST="${DIGEST//$'\n'/'%0A'}"
DIGEST="${DIGEST//$'\r'/'%0D'}"
echo "::set-output name=digest::$DIGEST"

I wonder whether it'd be easier for users if the input was base64-encoded:

set -euo pipefail
DIGEST=$(sha256sum binary-linux-amd64)
DIGESTS=$(echo -n "$DIGEST | base64 -w 0)
echo "::set-output name=digest::$DIGESTS"
set -euo pipefail
sha256sum binary-linux-amd64 > DIGESTS
sha256sum binary-linux-amd64-2 >> DIGESTS
sha256sum binary-linux-amd64-3 >> DIGESTS
DIGESTS=$(cat DIGESTS | base64 -w 0)
echo "::set-output name=digest::$DIGESTS"

I think it's effectively the same, because the string replacements have to be done just once even for multiple digests. If that's the case, we should at least document it. The only reason I'm proposing base64 is that the string substitution may be a little off-putting for some users.

Thoughts?

Metadata

Metadata

Assignees

Labels

area:genericIssue with the generic generator

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions