fix - deploy release with a commit hash

This commit is contained in:
Ishaan Jaff 2024-04-05 17:21:42 -07:00
parent 7fdb4e356a
commit 6f6c2d2648

View file

@ -242,18 +242,20 @@ jobs:
with: with:
github-token: "${{ secrets.GITHUB_TOKEN }}" github-token: "${{ secrets.GITHUB_TOKEN }}"
script: | script: |
const commitHash = "${{ github.event.inputs.commit_hash}}";
console.log("Commit Hash:", commitHash); // Add this line for debugging
try { try {
const response = await github.rest.repos.createRelease({ const response = await github.rest.repos.createRelease({
draft: false, draft: false,
generate_release_notes: true, generate_release_notes: true,
target_commitish: ${{ github.event.inputs.commit_hash}}, target_commitish: commitHash,
name: process.env.RELEASE_TAG, name: process.env.RELEASE_TAG,
owner: context.repo.owner, owner: context.repo.owner,
prerelease: false, prerelease: false,
repo: context.repo.repo, repo: context.repo.repo,
tag_name: process.env.RELEASE_TAG, tag_name: process.env.RELEASE_TAG,
}); });
core.exportVariable('RELEASE_ID', response.data.id); core.exportVariable('RELEASE_ID', response.data.id);
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
} catch (error) { } catch (error) {