Skip to content

Upload sbom artifacts #1

Upload sbom artifacts

Upload sbom artifacts #1

Workflow file for this run

name: Create release
on:
workflow_call:
inputs:
image-name:
description: "The name of the image"
required: true
type: string
version:
description: "The version of the image"
required: true
type: string
pretty-version:
description: "The pretty version of the image"
required: true
type: string
latest-image-ref:
description: "The latest image reference"
required: true
type: string
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Fetch Changelogs
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4
with:
pattern: changelog-${{ inputs.image-name }}-*
merge-multiple: true
path: /tmp/changelogs
- name: Prepare Release
id: prepare-release
shell: bash
run: |
echo "Automated release for ${{ inputs.image-name }} version \`${{ inputs.version }}\`." > ./changelog.md
for changelog in /tmp/changelogs/*.txt; do
# Remove empty Package Changes
sed -i '/^#### Package Changes$/{
N
N
/#### Package Changes\n[[:space:]]*-[[:space:]]*\n[[:space:]]*$/d
}' $changelog
# Remove empty Commits
sed -i '/^#### Commits$/{
N
N
/#### Commits\n[[:space:]]*-[[:space:]]*\n[[:space:]]*$/d
}' $changelog
# If there are no changes, remove the section altogether
sed -zi 's/\n### Changes since[^#]*$//' $changelog
cat $changelog >> ./changelog.md
done
cat <<'EOF' >> ./changelog.md
## How to rebase
If you're already using this image, upgrade with the following command:
```bash
sudo bootc upgrade
```
To switch to this image from another, type the following command in your terminal:
```bash
sudo bootc switch ${{ inputs.latest-image-ref }}
```
EOF
- name: Create Release
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2
with:
name: "${{ inputs.image-name }} version ${{ inputs.version }}"
tag_name: ${{ inputs.version }}
body_path: ./changelog.md
make_latest: true
files: *.spdx.json

Check failure on line 86 in .github/workflows/create-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-release.yml

Invalid workflow file

You have an error in your yaml syntax on line 86