Skip to content

Commit

Permalink
312
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Sep 27, 2024
1 parent 71a894a commit 5304322
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/change-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,28 @@ jobs:
- name: Wait for changes
run: sleep 20

# Step 8: Publish Release if Draft and Update tag_name
# Step 8: Publish Release if Draft
- name: Publish Release if Draft and Update tag_name
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const release = await github.rest.repos.getRelease({
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: context.payload.release.id
tag: context.payload.release.tag_name
});
// Debugging Release Data
console.log("Release data:", release);
if (release.draft) {
await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id,
draft: false,
tag_name: release.tag_name
tag_name: release.tag_name // Ensure tag_name is set correctly
});
core.info(`Release ${release.tag_name} published and tag updated successfully.`);
} else {
Expand Down

0 comments on commit 5304322

Please sign in to comment.