From 1e7f7c0a8eb34aa77fb755369451363c89c59b8c Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Thu, 14 Nov 2024 14:21:21 -0500 Subject: [PATCH] Restore previous release draft workflow file --- .sync/workflows/leaf/release-draft.yml | 40 ++------------------------ 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/.sync/workflows/leaf/release-draft.yml b/.sync/workflows/leaf/release-draft.yml index dac52e0f..f32a1b52 100644 --- a/.sync/workflows/leaf/release-draft.yml +++ b/.sync/workflows/leaf/release-draft.yml @@ -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: @@ -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 - # });