Skip to content

Commit

Permalink
Add asset downloads to changelog (#50)
Browse files Browse the repository at this point in the history
<!-- LIST CHANGES HERE -->
  • Loading branch information
norwd authored Nov 20, 2024
2 parents 6d8bd63 + d77d658 commit 9a5aeb4
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ jobs:
MEDIA_TYPE_HEADER: "Accept: application/vnd.github.raw"
AUTH_TOKEN_HEADER: "Authorization: Bearer ${{ github.token }}"

- id: latest-release
name: "Get Details of Latest Release"
run: gh api "${ENDPOINT}" --jq "${JQ_QUERY}" | tee -a "${GITHUB_OUTPUT}"
env:
ENDPOINT: '/repos/${{ vars.REPO_WITH_RELEASES }}/releases/latest'
JQ_QUERY: '"tag_name=" + (.tag_name | tostring)'

- name: "Generate an authors.yaml file"
run: gh api "${ENDPOINT}" --jq "${JQ_QUERY}" | tee authors.yaml
env:
Expand All @@ -66,13 +73,35 @@ jobs:
Please visit [https://www.jirastopwatch.com] for full introduction of JiraStopWatch and documentation.
{{range . -}}
{{ range . -}}
## [{{.name}}]({{ .html_url }})
{{- if .draft -}}
{{ " " }}![This is a draft release.](https://img.shields.io/badge/DRAFT-grey)
{{- else if .prerelease -}}
{{ " " }}![This is a pre-release.](https://img.shields.io/badge/PRE--RELEASE-orange)
{{- else if eq .tag_name "${{ steps.latest-release.outputs.tag_name }}" -}}
{{ " " }}![This is the latest release.](https://img.shields.io/badge/LATEST-green)
{{- end }}
{{ .body }}
{{ if .assets -}}
### Asset Downloads
{{- "\n" -}}
{{ range .assets }}
- [{{ or .label .name }}]({{ .browser_download_url }})
{{- end }}
## [{{.name}}]({{.html_url}}) {{if .draft}}![This is a draft release.](https://img.shields.io/badge/DRAFT-orange){{else if .prerelease}}![This is a pre-release.](https://img.shields.io/badge/PRE--RELEASE-orange){{end}}
{{ end }}
{{.body}}
{{- end }}
{{end -}}
{{- /* noop */ -}}
[https://www.jirastopwatch.com]: https://www.jirastopwatch.com
Expand Down

0 comments on commit 9a5aeb4

Please sign in to comment.