Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
schillij95 authored Aug 30, 2024
1 parent 3d1a3b6 commit eecd6db
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
script: |
const tag = 'latest-release';
// Get the latest commit SHA on the current branch (master)
const latestCommit = process.env.GITHUB_SHA;

// Attempt to get the release by tag
let release;
try {
Expand Down Expand Up @@ -80,15 +83,16 @@ jobs:
console.log(`Deleted release: ${release.data.id}`);
}

// Create a new release
// Create a new release with the latest commit SHA
console.log('Creating new release');
const newRelease = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: tag,
name: 'Latest Release',
draft: false,
prerelease: false
prerelease: false,
target_commitish: latestCommit // Ensure release points to the latest commit
});

core.setOutput('upload_url', newRelease.data.upload_url);
Expand Down

0 comments on commit eecd6db

Please sign in to comment.