Merge pull request #895 from tcely/patch-10

Start a library of useful functions for actions and workflows
This commit is contained in:
meeb 2025-03-28 14:02:36 +11:00 committed by GitHub
commit 744f1cde55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

10
.github/sh/library/variables.inc.sh vendored Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
# For setting single line variables in the environment or output
set_sl_var() { local f='%s=%s\n' ; printf -- "${f}" "$@" ; } ;
# Used together to set multiple line variables in the environment or output
mk_delim() { local f='%s_EOF_%d_' ; printf -- "${f}" "$1" "${RANDOM}" ; } ;
open_ml_var() { local f=''\%'s<<'\%'s\n' ; printf -- "${f}" "$2" "$1" ; } ;
close_ml_var() { local f='%s\n' ; printf -- "${f}" "$1" ; } ;