From ff23965aea6a48ea5f7d42b92dde2f5fd0677174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 24 Jun 2024 15:33:35 +0200 Subject: [PATCH] Enable patchinfo incident identifier generator This actions is using a number of public github actions, which got cloned to our src.suse.de gitea instance. In addtion it runs the patchinfo incident number generator after each commit. It is adding a strictly monotonic increasing number, but never overwrites any existing incident id. --- .gitea/workflows/patchinfo_numberator.yaml | 42 ++++++++++++++++++++++ patchinfo.ga/_patchinfo | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/patchinfo_numberator.yaml diff --git a/.gitea/workflows/patchinfo_numberator.yaml b/.gitea/workflows/patchinfo_numberator.yaml new file mode 100644 index 0000000..94900ea --- /dev/null +++ b/.gitea/workflows/patchinfo_numberator.yaml @@ -0,0 +1,42 @@ +# 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://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://src.suse.de/actions/github-actions-checkout@v4 + # Updating incident numbers + - name: Update all new _patchinfo files + uses: https://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://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' + skip_fetch: true + + diff --git a/patchinfo.ga/_patchinfo b/patchinfo.ga/_patchinfo index 1e8ab63..a37ecae 100644 --- a/patchinfo.ga/_patchinfo +++ b/patchinfo.ga/_patchinfo @@ -1,4 +1,4 @@ - + gboiko important no_updateinfo