Skip to content

Commit

Permalink
wire up changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed Nov 2, 2024
1 parent dfb1020 commit a7d551f
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 6 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/generate_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
on:
workflow_call:
fedora_version:
description: "Release Tag (e.g. stable or 41)"
type: string
required: true
workflow_dispatch:
inputs:
handwritten:
description: "Small Changelog about changes in this build"
make_latest:
description: "Make latest for Release"
type: choice
default: "false"
options:
- "false"
- "true"
fedora_version:
description: "Release Tag (e.g. stable or 41)"
required: true
type: choice
options:
- '["gts"]'
- '["stable"]'
- '["latest"]'
- '["beta"]'
- '["gts", "stable"]'
- '["gts", "stable", "latest", "beta"]'

permissions:
contents: write

name: Generate Release
jobs:
generate-release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson( inputs.fedora_version ) }}

steps:
- name: Checkout lass 500 commits (fot <commits> to work)
uses: actions/checkout@v4
with:
fetch-depth: 500

- name: Generate Release Text
id: generate-release-text
shell: bash
run: |

Check failure on line 51 in .github/workflows/generate_release.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/generate_release.yml#L51

Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner.
if [[ "${{ matrix.version }}" == "stable" ]]; then
version=stable-daily
else
version=${{ matrix.version }}
fi
python3 ./.github/changelog.py \
"${version}" \
./output.env \
./changelog.md \
--workdir . \
--handwritten "${{ github.event.inputs.handwritten }}"
source ./output.env
echo "title=${TITLE}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-relases@v@
with:
name: ${{ steps.generate-release-text.outputs.title }}
tag_name: ${{ steps.generate-release-text.outputs.tag }}
body_path: ./changelog.md
make_latest: ${{ inputs.make_latest == 'true' && matrix.version == 'stable' || false }}
prerelease: ${{ inputs.make_latest != 'false' }}
12 changes: 6 additions & 6 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ jobs:
fi
done
# generate_release:
# name: Generate Release
# needs: [check]
# if: github.event_name != 'pull_request'
# secrets: inherit
# uses: ./.github/workflows/generate_release.yml
generate_release:
name: Generate Release
needs: [check]
if: github.event_name != 'pull_request'
secrets: inherit
uses: ./.github/workflows/generate_release.yml

0 comments on commit a7d551f

Please sign in to comment.