From 62401adb916a4600faf55c998221aec756e0621c Mon Sep 17 00:00:00 2001 From: Gridness Date: Mon, 15 Sep 2025 15:01:51 +0300 Subject: [PATCH 1/4] Potential fix to the pipeline --- .github/workflows/create-release.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index e9ae226..ece4f6e 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -54,16 +54,17 @@ jobs: run: | python -c " import re + current_tag = '${{ env.current_tag }}' with open('README.md', 'r') as f: content = f.read() - # Replace revision patterns (adjust regex as needed for your README) new_content = re.sub( - r'(rev:\s*)[\w\.\-]+', # Matches 'rev: ' followed by version digits/dots/dashes - r'\1${{ env.current_tag }}', + r'(rev:\s*)[\w\.\-]+', + lambda m: m.group(1) + current_tag, content ) with open('README.md', 'w') as f: f.write(new_content) + print('Updated README with current tag revision') " - name: Configure git user From bf7db981fb982440c641a6853f4bccea4eff2502 Mon Sep 17 00:00:00 2001 From: Gridness Date: Mon, 15 Sep 2025 15:02:54 +0300 Subject: [PATCH 2/4] Temporarily added manual workflow dispatch --- .github/workflows/create-release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index ece4f6e..77ece97 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -5,6 +5,7 @@ on: tags: - "*.*.*" - "*.*" + workflow_dispatch: jobs: release: From 0fd61406d33c85e0d021f0e301b25831e7ccc213 Mon Sep 17 00:00:00 2001 From: Gridness Date: Mon, 15 Sep 2025 15:08:00 +0300 Subject: [PATCH 3/4] Temporarily changed dispatch to branch --- .github/workflows/create-release.yaml | 3 ++- README.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 77ece97..435fdc0 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -5,7 +5,8 @@ on: tags: - "*.*.*" - "*.*" - workflow_dispatch: + branches: + - "cicd/workflows/create-release/fix-pipe" jobs: release: diff --git a/README.md b/README.md index 949ff69..b376915 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Kubernetes Hooks +[![Dependabot Updates](https://github.com/Gridness/k8s-hooks/actions/workflows/dependabot/dependabot-updates/badge.svg)](https://github.com/Gridness/k8s-hooks/actions/workflows/dependabot/dependabot-updates) + This repository contains reusable Kubernetes-related Git hooks that simplify management of k8s resources manifests. Particularly useful for any gitops repositories # Available Hooks From c7513eefe3b38d3dc4bd50243c2a05c1270250cb Mon Sep 17 00:00:00 2001 From: Gridness Date: Mon, 15 Sep 2025 15:12:28 +0300 Subject: [PATCH 4/4] Changed logic to using and existing gh action for finding previous tag --- .github/workflows/create-release.yaml | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 435fdc0..d9467bb 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -5,8 +5,6 @@ on: tags: - "*.*.*" - "*.*" - branches: - - "cicd/workflows/create-release/fix-pipe" jobs: release: @@ -30,21 +28,9 @@ jobs: - name: Get previous tag id: previous_tag - run: | - git fetch --tags - mapfile -t tags < <(git tag --sort=-v:refname) - current_index=-1 - for i in "${!tags[@]}"; do - if [[ "${tags[i]}" == "${{ env.current_tag }}" ]]; then - current_index=$i - break - fi - done - if (( current_index > 0 )); then - echo "previous_tag=${tags[current_index-1]}" >> $GITHUB_ENV - else - echo "previous_tag=" >> $GITHUB_ENV - fi + uses: WyriHaximus/github-action-get-previous-tag@v1 + with: + fallback: 2.0 - name: Show tags run: |