@@ -2,15 +2,14 @@ set -euo pipefail
22sudo apt-get update -y && sudo apt-get install -y jq
33
44VCS=" github"
5-
65PIPE_NUM=" $( curl -sS -H " Circle-Token: ${CIRCLE_TOKEN} " " https://circleci.com/api/v2/pipeline/${CIRCLE_PIPELINE_ID} " | jq -r ' .number' ) "
76PIPELINE_NAME=" $( curl -sS -H " Circle-Token: ${CIRCLE_TOKEN} " " https://circleci.com/api/v2/pipeline/${CIRCLE_PIPELINE_ID} /workflow" | jq -r ' .items[0].name' ) "
87PIPELINE_URL=" https://app.circleci.com/pipelines/${VCS} /${CIRCLE_PROJECT_USERNAME} /${CIRCLE_PROJECT_REPONAME} /${PIPE_NUM} "
98WORKFLOW_URL=" ${PIPELINE_URL} /workflows/${CIRCLE_WORKFLOW_ID} "
109JOB_URL=" https://app.circleci.com/pipelines/${VCS} /${CIRCLE_PROJECT_USERNAME} /${CIRCLE_PROJECT_REPONAME} /${PIPE_NUM} /workflows/${CIRCLE_WORKFLOW_ID} /jobs/${CIRCLE_BUILD_NUM} "
1110
1211MSG=" $( cat << EOF
13- ----------- Circle-Ci Error: -------------
12+ ----------- Circle-Ci Error -------------
1413
1514project_name=${CIRCLE_PROJECT_REPONAME}
1615org=${CIRCLE_PROJECT_USERNAME}
@@ -28,13 +27,13 @@ job_url=${JOB_URL}
2827------------------------------------------
2928EOF
3029) "
31- # Sustituye los placeholders por sus valores
30+ # Replace the placeholders with their values
3231MSG=" ${MSG//% PIPELINE_URL%/ ${PIPELINE_URL} } "
3332MSG=" ${MSG//% WORKFLOW_URL%/ ${WORKFLOW_URL} } "
3433
3534
36- # Construye JSON con jq; preserva saltos de línea como \n
35+ # Build JSON with jq; preserve line breaks as \n
3736PAYLOAD=" $( jq -n --arg t " $MSG " ' {text:$t}' ) "
3837
39- # Exporta para el orb de Slack
38+ # Export for the Slack orb
4039printf ' export SLACK_PARAM_CUSTOM=%q\n' " $PAYLOAD " >> " $BASH_ENV "
0 commit comments