diff --git a/entrypoint.sh b/entrypoint.sh index c41524f..ea2a40e 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 @@ -37,8 +36,9 @@ 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"} -URL=https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${PRNUM}/commits +PRNUM=${PR%"/merge"} # GitHub +PRNUM=${PRNUM%"/head"} # Forgejo +URL=${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/pulls/${PRNUM}/commits echo " - API endpoint: $URL" list=$(curl $URL "${HEADERS[@]}" -X GET -s | jq '.[].sha' -r)