-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (46 loc) · 1.64 KB
/
wingman-update-release-notes.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Update Wingman Release Notes
on:
workflow_run:
workflows: ['Wingman App Build and Release']
types:
- completed
jobs:
update-release-notes:
permissions: write-all
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Artifact with Tag Name
uses: actions/download-artifact@v4
id: tag-artifact
with:
name: tag-name
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Read Tag Name
id: tag
run: |
tag=$(cat ${{ steps.tag-artifact.outputs.download-path }}/tag.txt)
echo "The tag is $tag"
# set an environment variable to pass to the next step
echo "TAG=$tag" >> $GITHUB_ENV
- name: Update Release Notes with Download Table
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# $tag = git describe --tags $(git rev-list --tags --max-count=1)
# $tag=${{ env.TAG }}
$tag = $env:TAG
Write-Output "Updating release notes for tag $tag"
gh release edit "$tag" --prerelease=true --draft=false
$markdownTable = ./make-download-table.ps1 -tag "$tag"
if (-not $markdownTable) {
Write-Error "Failed to generate markdown table."
exit 1
}
gh release edit "$tag" --title "Wingman $tag" --notes "$markdownTable" --draft=false --prerelease=false --latest=true