From 84cb40da124beb7c79dff4a335e36dd41acbd1dc Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Wed, 21 Feb 2024 13:10:48 +0100 Subject: [PATCH] factor out slack post into separate action --- entrypoint.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index c6052b5..fefb514 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,20 +2,20 @@ set -e ls -lR -trap 'catch $? $LINENO' EXIT -catch() { - local SLACKAPI="https://ropensci.slack.com/api/chat.postMessage" - local RUNURL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - if [ "$1" != "0" ]; then - local STATUS=FAIL - else - local STATUS=OK - return # only post failures now - fi - echo "::group::Post status to slack" - curl -sS $SLACKAPI -d "text=Deploy $STATUS: $RUNURL" -d "channel=deployments" -H "Authorization: Bearer $SLACK_TOKEN" - echo "::endgroup::" -} +# trap 'catch $? $LINENO' EXIT +# catch() { +# local SLACKAPI="https://ropensci.slack.com/api/chat.postMessage" +# local RUNURL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" +# if [ "$1" != "0" ]; then +# local STATUS=FAIL +# else +# local STATUS=OK +# return # only post failures now +# fi +# echo "::group::Post status to slack" +# curl -sS $SLACKAPI -d "text=Deploy $STATUS: $RUNURL" -d "channel=deployments" -H "Authorization: Bearer $SLACK_TOKEN" +# echo "::endgroup::" +# } # Upload source first mv package-source package-00source