automatically append GITHUB_REPO folder
this is for the case where you might want to push to a folder named as the repo, as is often the case. It's another thing you have to type otherwise.
question:
sorry, that was a bad commit indeed.
Here's the correct one: https://github.com/maxheld83/ghaction-rsync/tree/54878e91d6823cb53244eccc69475e245a6471f7
Steps to reproduce: Create some environment variable in the entrypoint.sh (here, the
JUST_GH_REPONAMEshortened fromGITHUB_REPOSITORY. Echo that environment variable in the entrypoint.sh (works, see logs) Then use that created environment variable inmain.workflowto append theargspassed to the last command in entrypoint.sh.This is the offending part of the main.workflow:
args = [ "$GITHUB_WORKSPACE/index.html", "pfs400wm@$HOST_NAME:/proj/websource/docs/FAU/fakultaet/phil/www.datascience.phil.fau.de/websource/$JUST_GH_REPONAME" ]
Naively, I assumed that this would cause the environment variable to be evaluated inside the container (in entrypoint.sh), because the whole args section is just appended to the last command of entrypoint.sh. And we know that inside entrypoint.sh, $JUST_GH_REPONAME is defined (as per echos).
But that does not appear to be the case; instead, it apparently gets evaluated earlier, is found to be NULL, and thus never appended to the path.
Does that make sense?
answer:
Thanks for writing back and sharing that with us! Custom environment variables (like the $JUST_GH_REPONAME) defined in the ENTRYPOINT file aren't expanded if cited as one of the values in args. Given your setup, we recommend appending that custom environment variable within the ENTRYPOINT directly.
While we realize this may not be an ideals setup for you, other integrators have shared their experience with interpolation and escaping variables in bash since the Actions Beta has released. I've added your case internally so the team can review this and consider your experience for future iterations.
so the bottom line seems to be that when pasted into arg, this stuff automatically gets escaped, and these escapes prevent that $JUST_GH_REPONAME gets evaluated.
can't think of an elegant way to implement this without greatly complicating the design, so this is going to remain blocked.
this might actually work if we test inside the entrypoint whether 1st argument is given, and then to default to $JUST_GH_REPONAME