Fix variable substitution

This commit is contained in:
Carles Pina i Estany 2022-09-16 00:11:21 +01:00
parent cd04ca4f15
commit 18caea3525

View File

@ -1,5 +1,6 @@
#!/bin/sh -l #!/bin/sh -l
set -x
set -e # if a command fails it stops the execution set -e # if a command fails it stops the execution
set -u # script fails if trying to access to an undefined variable set -u # script fails if trying to access to an undefined variable
@ -126,8 +127,10 @@ echo "[+] Files that will be pushed"
ls -la ls -la
ORIGIN_COMMIT="https://$GITHUB_SERVER/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" ORIGIN_COMMIT="https://$GITHUB_SERVER/$GITHUB_REPOSITORY/commit/$GITHUB_SHA"
COMMIT_MESSAGE="${COMMIT_MESSAGE/ORIGIN_COMMIT/$ORIGIN_COMMIT}" #COMMIT_MESSAGE="${COMMIT_MESSAGE/ORIGIN_COMMIT/$ORIGIN_COMMIT}"
COMMIT_MESSAGE="${COMMIT_MESSAGE/\$GITHUB_REF/$GITHUB_REF}" #COMMIT_MESSAGE="${COMMIT_MESSAGE/\$GITHUB_REF/$GITHUB_REF}"
COMMIT_MESSAGE="Update from $ORIGIN_COMMIT"
echo "[+] Set directory is safe ($CLONE_DIR)" echo "[+] Set directory is safe ($CLONE_DIR)"
# Related to https://github.com/cpina/github-action-push-to-another-repository/issues/64 and https://github.com/cpina/github-action-push-to-another-repository/issues/64 # Related to https://github.com/cpina/github-action-push-to-another-repository/issues/64 and https://github.com/cpina/github-action-push-to-another-repository/issues/64