Skip to content

Commit

Permalink
Restore previous release draft workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
makubacki committed Nov 14, 2024
1 parent 222451f commit 1e7f7c0
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions .sync/workflows/leaf/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ name: Update Release Draft
on:
push:
branches:
- {{ trigger_branch_name if trigger_branch_name else sync_version.latest_mu_release_branch | replace ("release", "dev") }}
- {{ trigger_branch_name if trigger_branch_name else sync_version.latest_mu_release_branch }}

jobs:
draft:
Expand All @@ -34,41 +34,5 @@ jobs:
contents: write
pull-requests: write

uses: makubacki/mu_devops/.github/workflows/ReleaseDrafter.yml@{{ sync_version.mu_devops }}
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@{{ sync_version.mu_devops }}
secrets: inherit

steps:
- name: Get Draft Release Details
id: get-latest-release
if: {{ true if not trigger_branch_name else false }}
uses: actions/github-script@v7
with:
script: |
const releases = await github.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
});
const latestDraftRelease = releases.data.find(release => release.target_commitish === process.env.SOURCE_BRANCH && release.draft);
if (!latestDraftRelease) {
throw new Error(`No draft release found for branch ${process.env.SOURCE_BRANCH}`);
}
console.log(`Latest Release Draft Found: ${latestDraftRelease.name} (${latestDraftRelease.tag_name})\n`);
return latestDraftRelease;
# - name: Draft Release for Release Branch
# uses: actions/github-script@v7
# if: {{ true if not trigger_branch_name else false }}
# with:
# script: |
# const latestDraftRelease = ${getLatestRelease.outputs.result};
# const newTag = `release-${latestDraftRelease.tag_name}`;
# await github.repos.createRelease({
# owner: context.repo.owner,
# repo: context.repo.repo,
# tag_name: newTag,
# target_commitish: process.env.TARGET_BRANCH,
# name: latestDraftRelease.name,
# body: latestDraftRelease.body,
# draft: true,
# prerelease: latestDraftRelease.prerelease
# });

0 comments on commit 1e7f7c0

Please sign in to comment.