Skip to content

Commit

Permalink
fix(github): use latest commit sha
Browse files Browse the repository at this point in the history
For pull requests, GitHub Actions checks out the repo by simulating a merge commit of the PR. But we always want the SHA of the last commit, not the simulated merge commit.
  • Loading branch information
hazzuk committed Jan 26, 2025
1 parent 3639173 commit 77d5ba9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
# These must be set for fetchdep.sh to get the right branch
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
permissions: {} # No permissions required
jobs:
build:
Expand Down
5 changes: 3 additions & 2 deletions scripts/get-version-from-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ set -e

# Since the deps are fetched from git, we can rev-parse
JSSDK_SHA=$(git -C node_modules/matrix-js-sdk rev-parse --short=7 HEAD)
VECTOR_SHA=$(git rev-parse --short=7 HEAD) # use the ACTUAL SHA rather than assume develop
echo $VECTOR_SHA-js-$JSSDK_SHA
#VECTOR_SHA=$(git rev-parse --short=7 HEAD) # use the ACTUAL SHA rather than assume develop
#echo $VECTOR_SHA-js-$JSSDK_SHA
echo "${COMMIT_SHA:0:7}-js-$JSSDK_SHA"

0 comments on commit 77d5ba9

Please sign in to comment.