Skip to content

Update dependency kopf to v1.37.2 #70

Update dependency kopf to v1.37.2

Update dependency kopf to v1.37.2 #70

Workflow file for this run

name: Create a draft release
on:
push:
branches:
- main
jobs:
draft-release:
if: github.repository_owner == 'telekom-mms' # do not run this elsewhere
permissions:
contents: write
issues: read
pull-requests: read
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
persist-credentials: false
- name: Get Previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce" # v1.4.0
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Calculate next version
id: version
uses: patrickjahns/version-drafter-action@fda4b8e4017bee5dd5794f255a4d484e8e647561 # v1.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate changelog
uses: heinrichreimer/action-github-changelog-generator@e60b5a2bd9fcd88dadf6345ff8327863fb8b490f # v2.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
futureRelease: ${{ steps.version.outputs.next-version }}
- name: Update YAML File with next version
uses: mikefarah/yq@c35ec752e38ea0c096d3c44e13cfc0797ac394d8 # v4.43.1
with:
cmd: |
yq e '.operator.trivyDojoReportOperator.image.tag = "${{ steps.version.outputs.next-version }}"' -i charts/values.yaml
yq e '.appVersion = "${{ steps.version.outputs.next-version }}"' -i charts/Chart.yaml
yq e '.version = "${{ steps.version.outputs.next-version }}"' -i charts/Chart.yaml
yq e '.spec.template.spec.containers[0].image = "ghcr.io/telekom-mms/docker-trivy-dojo-operator:${{ steps.version.outputs.next-version }}"' -i deploy/deployment.yaml
- name: Push Updates to YAML Files with next version
uses: github-actions-x/commit@722d56b8968bf00ced78407bbe2ead81062d8baa # v2.9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: main
commit-message: Update version to ${{ steps.version.outputs.next-version }}
force-add: 'true'
files: charts/values.yaml charts/Chart.yaml deploy/deployment.yaml CHANGELOG.md
name: Deutsche Telekom MMS
email: [email protected]
# do a second checkout to prevent race situation
# changelog gets updated but action works on old commit id
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: main
- name: Generate changelog for the release
run: |
sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md
- name: Read CHANGELOG.md
id: package
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1
with:
path: ./CHANGELOGRELEASE.md
- name: Create Release draft
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
release_name: ${{ steps.version.outputs.next-version }}
tag_name: ${{ steps.version.outputs.next-version }}
body: |
${{ steps.package.outputs.content }}
draft: true