fix(ping/rust): Don't set PR ref for master build (#79)

When building the `master` image we would previously mistakingly set the
ref to the PR commit hash.

This surfaced when testing a pull request from a fork. `master` would be
pointed at the forks HEAD commit hash, but not the fork URL. Thus the
build could not find the commit and would fail. See
https://github.com/libp2p/rust-libp2p/pull/3154
This commit is contained in:
Max Inden 2022-11-23 10:52:07 +01:00 committed by GitHub
parent 17dcc6cd49
commit da5bbf715a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@
[groups.build_config.build_args] [groups.build_config.build_args]
BINARY_NAME = '{{ .BinaryName }}' BINARY_NAME = '{{ .BinaryName }}'
GIT_REF = '{{ $.Env.GitReference }}' GIT_REF = "master"
{{ end }} {{ end }}
{{ if $.Env.GitReference }} {{ if $.Env.GitReference }}

View File

@ -11,7 +11,7 @@ ARG GIT_TARGET=""
RUN if [ ! -z "${GIT_TARGET}" ]; then sed -i "s,^git.*,git = \"https://${GIT_TARGET}\"," ./plan/Cargo.toml; fi RUN if [ ! -z "${GIT_TARGET}" ]; then sed -i "s,^git.*,git = \"https://${GIT_TARGET}\"," ./plan/Cargo.toml; fi
ARG GIT_REF="" ARG GIT_REF=""
RUN if [ ! -z "${GIT_REF}" ]; then sed -i "s/^rev.*/rev = \"${GIT_REF}\"/" ./plan/Cargo.toml; fi RUN if [ ! -z "${GIT_REF}" ]; then sed -i "s/^rev.*/branch = \"${GIT_REF}\"/" ./plan/Cargo.toml; fi
# Build the requested binary: Cargo will update lockfile on changed manifest (i.e. if one of the above `sed`s patched it). # Build the requested binary: Cargo will update lockfile on changed manifest (i.e. if one of the above `sed`s patched it).
ARG BINARY_NAME ARG BINARY_NAME