diff --git a/.github/scripts/prData.js b/.github/scripts/prData.js index 2a72b28748..3681859fa0 100644 --- a/.github/scripts/prData.js +++ b/.github/scripts/prData.js @@ -24,11 +24,11 @@ async function fetchPullRequests(github, owner, repo, sha) { * @param {string} repo - The repository name. * @returns {Promise} - A promise resolving to the SHA of the latest commit on the main branch. */ -async function fetchMainBranchSha(github, owner, repo) { +async function fetchMainBranchSha(github, owner, repo, ref) { const { data } = await github.rest.repos.getCommit({ owner, repo, - ref: 'heads/main', + ref: ref }); if (data && data.sha) { @@ -94,7 +94,7 @@ async function prData(params) { try { const pullRequestData = await fetchPullRequests(github, owner, repo, sha); const currentVersion = await getReleaseVersionValue(github, owner, repo); - const mainBranchSha = await fetchMainBranchSha(github, owner, repo); + const mainBranchSha = await fetchMainBranchSha(github, owner, repo, sha); const labels = pullRequestData.data[0].labels; const prNumber = pullRequestData.data[0].number; diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml index 92e8b0d464..d4c5f2aa1d 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -75,7 +75,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 with: - ref: ${{ steps.set-outputs.outputs.tag }} + ref: ${{ needs.setup-environment.outputs.tag }} - name: Build and Push Artifacts uses: ./.github/actions/build-push-artifacts with: