Merge pull request 'Enable patchinfo incident number generator' (#60) from adrianSuSE/SLFO:1.1 into 1.1

Reviewed-on: https://src.suse.de/products/SLFO/pulls/60
Reviewed-by: Ruediger Oertel <ro@suse.com>
Reviewed-by: Marcus Meissner <meissner@suse.com>
This commit is contained in:
Ruediger Oertel 2024-11-11 15:34:39 +01:00
commit 8331c8b7ba

View File

@ -0,0 +1,41 @@
# Use this as .gitea/workflows/patchinfo_numberator.yaml in all products/* repos
name: Patchinfo ID numberator
run-name: ${{ gitea.actor }} is setting patchinfo numbers
on: [push]
jobs:
use-go-action:
runs-on: tumbleweed
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
# We should provide go with our image already?
- name: Setup Go
uses: https://token:${{ secrets.REPO_WRITE }}@src.suse.de/actions/github-setup-go@v5
with:
go-version: '1.20'
# To be obsoleted
- run: |
zypper ar http://download.suse.de/ibs/SUSE:/CA/openSUSE_Factory CA
zypper ref
zypper in -y ca-certificates-suse ca-certificates-suse-ucs
# Generic action from GitHub to clone the product git repo
- name: Checkout product
uses: https://token:${{ secrets.REPO_WRITE }}@src.suse.de/actions/github-actions-checkout@v4
# Updating incident numbers
- name: Update all new _patchinfo files
uses: https://token:${{ secrets.REPO_WRITE }}@src.suse.de/actions/patchinfo-numbering-action@v0
- name: Get last commit message
id: last-commit
run: |
echo "author=$(git log -1 --pretty=\"%an <%ae>\")" >> $GITHUB_OUTPUT
- name: Commit changes back
uses: https://token:${{ secrets.REPO_WRITE }}@src.suse.de/actions/stefanzweifel-git-auto-commit-action@v5
with:
commit_author: ${{ steps.last-commit.outputs.author }}
commit_message: "Update incident numbers"
commit_options: '--no-edit'