Skip to content

Commit

Permalink
Update update-manifest.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kongo09 authored Nov 23, 2024
1 parent 4da9b3b commit 67e2ce2
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/update-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,28 @@ jobs:
git push origin ${{ github.ref_name }}
# Update the release
- name: Create Release
id: create_release
uses: actions/create-release@v1
- name: Publish Draft Release
id: publish_release
uses: actions/github-script@v4
with:
script: |
const { data: releases } = await github.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
});
const draftRelease = releases.find(release => release.draft && release.tag_name === process.env.GITHUB_REF_NAME);
if (draftRelease) {
await github.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: draftRelease.id,
draft: false
});
} else {
core.setFailed('No draft release found');
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: false
prerelease: ${{ github.event.release.prerelease }}

GITHUB_REF_NAME: ${{ github.ref_name }}

0 comments on commit 67e2ce2

Please sign in to comment.