Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set git revision at build from env variable #2428

Merged
merged 3 commits into from
Jan 28, 2022
Merged

Conversation

feedmeapples
Copy link
Contributor

@feedmeapples feedmeapples commented Jan 28, 2022

What changed?

Allows to set git revision at build from env variable

Why?

Github actions only fetch one commit of data for submodules and not git history, hence the build was throwing "not a git repository"
https://github.com/temporalio/docker-builds/runs/4975313307?check_suite_focus=true#step:7:321

There is an option to fetch git history but seems only for the root project and not the submodules, using fetch_depth param, see https://github.com/actions/checkout#checkout-v2

How did you test it?

$ bash develop/scripts/create_build_info_data.sh

$ cat ./build/info/data.json 
{"gitRevision":"864150a00","buildTimeUnix":1643337842}

$ export GITHUB_SHA_SHORT=333

$ bash develop/scripts/create_build_info_data.sh

$ cat ./build/info/data.json 

{"gitRevision":"333","buildTimeUnix":1643337908}

Potential risks

Is hotfix candidate?

@feedmeapples feedmeapples requested a review from a team January 28, 2022 02:39
@feedmeapples feedmeapples marked this pull request as draft January 28, 2022 02:41
@feedmeapples feedmeapples force-pushed the set_revision_from_env branch from 48cdb0c to 864150a Compare January 28, 2022 02:43
@feedmeapples feedmeapples marked this pull request as ready for review January 28, 2022 02:45
@feedmeapples feedmeapples force-pushed the set_revision_from_env branch 2 times, most recently from d43aaae to 6d1df7f Compare January 28, 2022 03:00
@feedmeapples feedmeapples force-pushed the set_revision_from_env branch from 6d1df7f to 8e4b82d Compare January 28, 2022 03:05
Co-authored-by: Alex Shtin <alex@temporal.io>
@feedmeapples feedmeapples merged commit 6c1f2ff into master Jan 28, 2022
@feedmeapples feedmeapples deleted the set_revision_from_env branch January 28, 2022 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants