From 2c19ded9655acf38b13fc8457ee07e8e44a13a64 Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Thu, 22 Jan 2026 13:43:52 +0100 Subject: [PATCH 1/3] Use variable to point to API Useful for using this code on ForgeJo Actions. Signed-off-by: David Heidelberg --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index c41524f..f7c30ce 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -38,7 +38,7 @@ echo echo -e "\e[0;34mGet the list of commits included in the PR($GITHUB_REF).\e[0m" PR=${GITHUB_REF#"refs/pull/"} PRNUM=${PR%"/merge"} -URL=https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${PRNUM}/commits +URL=${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/pulls/${PRNUM}/commits echo " - API endpoint: $URL" list=$(curl $URL "${HEADERS[@]}" -X GET -s | jq '.[].sha' -r) From 4a07d808bafc0083c38fdeddb7a85ee15ae37cca Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Thu, 22 Jan 2026 14:03:36 +0100 Subject: [PATCH 2/3] Correct path to work also with Forgejo Forgejo does use slightly different path, adapt to it. Signed-off-by: David Heidelberg --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f7c30ce..97bb13f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,7 +37,8 @@ fi echo echo -e "\e[0;34mGet the list of commits included in the PR($GITHUB_REF).\e[0m" PR=${GITHUB_REF#"refs/pull/"} -PRNUM=${PR%"/merge"} +PRNUM=${PR%"/merge"} # GitHub +PRNUM=${PR%"/head"} # Forgejo URL=${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/pulls/${PRNUM}/commits echo " - API endpoint: $URL" From 07b9e91e85edbdc3453ddc283dfd7b3fe7504bb2 Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Thu, 22 Jan 2026 14:24:52 +0100 Subject: [PATCH 3/3] Remove ls -la, as it's too verbose While this seems to be useful for plugin debugging, for normal usage it's not necessary. Signed-off-by: David Heidelberg --- entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 97bb13f..b97a3bd 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,7 +13,6 @@ echo "REF: $GITHUB_REF" echo "HEAD-REF: $GITHUB_HEAD_REF" echo "BASE-REF: $GITHUB_BASE_REF" pwd -ls -la `pwd` id # Add safe directory option for github workspace to disable fatal error