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

[BIOMAGE-2014] Using latest branch commit to tag docker images & validate PRs #756

Merged
merged 2 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,14 @@ jobs:
# this is what we push to ECR
# we will also take semver'd tags like `1.0.0` and use them for releases

# In push & PR events we want the tag to contain the latest commit on the branch:
# in push events, the latest commit of the master branch is GITHUB_SHA
# in PR synch the latest commit of the branch is found in github.event.pull_request.head.sha instead

if [ "${{ github.event_name }}" = "release" ] && [ "${{ github.event.action }}" = "released" ]; then
echo "::set-output name=tag::${REF_ID/refs-tags-/}"
elif [ "${{ github.event_name }}" = "pull_request" ]; then
echo "::set-output name=tag::$REF_ID-${{ github.event.pull_request.head.sha }}"
else
echo "::set-output name=tag::$REF_ID-$GITHUB_SHA"
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr_validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ jobs:
if: steps.check-e2e-run.outputs.should-e2e-run == 'true'
name: Get details of last commit
run: |-
echo "SHA of GitHub merge commit:"
echo $GITHUB_SHA
echo "::set-output name=github_sha::$GITHUB_SHA"
echo "SHA of latest GitHub branch commit:"
echo ${{ github.event.pull_request.head.sha }}
echo "::set-output name=github_sha::${{ github.event.pull_request.head.sha }}"

REPO_NAME=$(echo $GITHUB_REPOSITORY | awk -F '/' '{print $2}')
echo "Repo name:"
Expand Down