chore: cascade forgejo pull request out of the runner branch or PR (followup)

The SHA must be reachable from a branch or tags to be discovered by go
mod tidy.
This commit is contained in:
Earl Warren 2025-08-18 12:28:56 +02:00
parent 096d57953c
commit 2286f71dd5
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -29,6 +29,15 @@ cd $forgejo
# #
find * -name '*.go' -o -name 'go.mod' | xargs sed -i -E -e "s|code.forgejo.org/forgejo/runner/v[0-9]+|$module|" find * -name '*.go' -o -name 'go.mod' | xargs sed -i -E -e "s|code.forgejo.org/forgejo/runner/v[0-9]+|$module|"
# #
# If it is a pull request, change the module to reference the forked repository so
# go mod tidy can find the SHA from a known branch or tag
#
if test -f "$runner_pr_or_ref"; then
repository=$(jq --raw-output .head.repo.full_name <$runner_pr_or_ref)
test "$repository"
module=$(echo $module | sed -e "s|code.forgejo.org/forgejo/runner|code.forgejo.org/$repository|")
fi
#
# add a "replace code.forgejo.org/forgejo/runner/v?? $sha" line to the forgejo go.mod # add a "replace code.forgejo.org/forgejo/runner/v?? $sha" line to the forgejo go.mod
# so that it uses the branch or pull request from which the cascade is run. # so that it uses the branch or pull request from which the cascade is run.
# #