Skip to content

Commit 910d9d8

Browse files
committed
Add magic links to step summary
1 parent 7d02474 commit 910d9d8

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

print-pkg-names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def safe_parse_pkg_name(file_path: pathlib.Path) -> str | None:
2424
return None
2525

2626

27-
packages_dir = pathlib.Path(sys.argv[1]).resolve().absolute()
27+
packages_dir = pathlib.Path(sys.argv[1]).resolve()
2828

2929
pkg_names = {safe_parse_pkg_name(f) for f in packages_dir.iterdir()}
3030
pkg_names.discard(None)

requirements/runtime.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ multidict==6.0.5
6464
nh3==0.2.17
6565
# via readme-renderer
6666
packaging==24.1
67-
# via pypi-attestations
67+
# via
68+
# -r runtime.in
69+
# pypi-attestations
6870
pkginfo==1.10.0
6971
# via twine
7072
platformdirs==4.2.2

twine-upload.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ The workflow was run with 'attestations: true' input, but the specified \
6969
repository URL does not support PEP 740 attestations. As a result, the \
7070
attestations input is ignored."
7171

72+
MAGIC_LINK_MESSAGE="::warning title=Create a Trusted Publisher::\
73+
A new Trusted Publisher for the currently running publishing workflow can be created \
74+
by accessing the following link(s) while logged-in as an owner of the package(s):"
75+
7276
if [[ ! "${INPUT_REPOSITORY_URL}" =~ pypi\.org || ${#PACKAGE_NAMES[@]} -eq 0 ]] ; then
7377
TRUSTED_PUBLISHING_MAGIC_LINK_NUDGE=""
7478
else
@@ -79,13 +83,11 @@ else
7983
fi
8084
ALL_LINKS=""
8185
for PACKAGE_NAME in "${PACKAGE_NAMES[@]}"; do
82-
LINK="${INDEX_URL}/manage/project/${PACKAGE_NAME}/settings/publishing/?provider=github&owner=${GITHUB_REPOSITORY_OWNER}&repository=${REPOSITORY_NAME}&workflow_filename=${WORKFLOW_FILENAME}"
86+
LINK="- ${INDEX_URL}/manage/project/${PACKAGE_NAME}/settings/publishing/?provider=github&owner=${GITHUB_REPOSITORY_OWNER}&repository=${REPOSITORY_NAME}&workflow_filename=${WORKFLOW_FILENAME}"
8387
ALL_LINKS+="$LINK"$'\n'
8488
done
85-
TRUSTED_PUBLISHING_MAGIC_LINK_NUDGE="::warning title=Create a Trusted Publisher::\
86-
A new Trusted Publisher for the currently running publishing workflow can be created \
87-
by accessing the following link(s) while logged-in as a maintainer of the package(s): \"
88-
${ALL_LINKS}"
89+
TRUSTED_PUBLISHING_MAGIC_LINK_NUDGE="${MAGIC_LINK_MESSAGE}\n${ALL_LINKS}"
90+
echo "${MAGIC_LINK_MESSAGE}" >> $GITHUB_STEP_SUMMARY
8991
fi
9092

9193
[[ "${INPUT_USER}" == "__token__" && -z "${INPUT_PASSWORD}" ]] \

0 commit comments

Comments
 (0)