Skip to content

Commit 75191de

Browse files
committed
ci(release): trim GitLab trigger output
1 parent 8030003 commit 75191de

3 files changed

Lines changed: 42 additions & 6 deletions

File tree

.github/workflows/branch-checks.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ jobs:
111111
WHEEL_FILENAMES: openshell-branch-check-py3-none-any.whl,openshell-branch-check-manylinux_x86_64.whl
112112
run: |
113113
set -euo pipefail
114-
curl -X POST \
114+
response=$(curl -X POST \
115115
--fail \
116+
--silent \
117+
--show-error \
116118
-F "token=${GITLAB_CI_TRIGGER_TOKEN}" \
117119
-F "ref=feat/ci-trigger-pipeline" \
118120
-F "variables[PIPELINE_ACTION]=publish_wheels" \
@@ -121,4 +123,14 @@ jobs:
121123
-F "variables[RELEASE_VERSION]=branch-check-pr-${{ github.event.pull_request.number }}" \
122124
-F "variables[RELEASE_KIND]=dev" \
123125
-F "variables[WHEEL_FILENAMES]=${WHEEL_FILENAMES}" \
124-
"${GITLAB_CI_TRIGGER_URL}"
126+
"${GITLAB_CI_TRIGGER_URL}")
127+
RESPONSE_JSON="$response" python - <<'PY'
128+
import json
129+
import os
130+
131+
response = json.loads(os.environ["RESPONSE_JSON"])
132+
print(
133+
f"Triggered GitLab pipeline {response['id']} "
134+
f"with status={response['status']}"
135+
)
136+
PY

.github/workflows/release-dev.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,10 @@ jobs:
494494
fi
495495
496496
WHEEL_FILENAMES=$(printf '%s\n' "${wheel_files[@]##*/}" | paste -sd, -)
497-
curl -X POST \
497+
response=$(curl -X POST \
498498
--fail \
499+
--silent \
500+
--show-error \
499501
-F "token=${GITLAB_CI_TRIGGER_TOKEN}" \
500502
-F "ref=main" \
501503
-F "variables[PIPELINE_ACTION]=publish_wheels" \
@@ -504,4 +506,14 @@ jobs:
504506
-F "variables[RELEASE_VERSION]=${RELEASE_VERSION}" \
505507
-F "variables[RELEASE_KIND]=dev" \
506508
-F "variables[WHEEL_FILENAMES]=${WHEEL_FILENAMES}" \
507-
"${GITLAB_CI_TRIGGER_URL}"
509+
"${GITLAB_CI_TRIGGER_URL}")
510+
RESPONSE_JSON="$response" python - <<'PY'
511+
import json
512+
import os
513+
514+
response = json.loads(os.environ["RESPONSE_JSON"])
515+
print(
516+
f"Triggered GitLab pipeline {response['id']} "
517+
f"with status={response['status']}"
518+
)
519+
PY

.github/workflows/release-tag.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,10 @@ jobs:
519519
fi
520520
521521
WHEEL_FILENAMES=$(printf '%s\n' "${wheel_files[@]##*/}" | paste -sd, -)
522-
curl -X POST \
522+
response=$(curl -X POST \
523523
--fail \
524+
--silent \
525+
--show-error \
524526
-F "token=${GITLAB_CI_TRIGGER_TOKEN}" \
525527
-F "ref=main" \
526528
-F "variables[PIPELINE_ACTION]=publish_wheels" \
@@ -529,4 +531,14 @@ jobs:
529531
-F "variables[RELEASE_VERSION]=${RELEASE_VERSION}" \
530532
-F "variables[RELEASE_KIND]=stable" \
531533
-F "variables[WHEEL_FILENAMES]=${WHEEL_FILENAMES}" \
532-
"${GITLAB_CI_TRIGGER_URL}"
534+
"${GITLAB_CI_TRIGGER_URL}")
535+
RESPONSE_JSON="$response" python - <<'PY'
536+
import json
537+
import os
538+
539+
response = json.loads(os.environ["RESPONSE_JSON"])
540+
print(
541+
f"Triggered GitLab pipeline {response['id']} "
542+
f"with status={response['status']}"
543+
)
544+
PY

0 commit comments

Comments
 (0)