From e807cc5094dc7b3fc2d26a19d8dc6cf1044dc490 Mon Sep 17 00:00:00 2001 From: borislavr Date: Mon, 30 Mar 2026 07:35:33 +0000 Subject: [PATCH 1/2] feat(ci): added new workflow to bump test-workflows version related issue https://github.com/Netcracker/qubership-workflow-hub/issues/682 --- .../bump-test-workflows-version.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/bump-test-workflows-version.yaml diff --git a/.github/workflows/bump-test-workflows-version.yaml b/.github/workflows/bump-test-workflows-version.yaml new file mode 100644 index 00000000..eaf338a2 --- /dev/null +++ b/.github/workflows/bump-test-workflows-version.yaml @@ -0,0 +1,57 @@ +--- +# ℹ️ The workflow is to consistently 'update netcracker/qubership-test-pipelines' versions and 'pipeline_branch' parameter in workflow files. +# ⚠️ The workflow uses PAT (GH_ACCESS_TOKEN) with extended permissions. The PAT must have `contents: write` and `workflows: write` permissions. + +name: Bump qubership-test-pipelines version +on: workflow_dispatch +jobs: + bump: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Get latest release tag SHA + run: | + latest_release_tag=$(curl -s https://api.github.com/repos/netcracker/qubership-test-pipelines/releases/latest | jq -r '.tag_name') + latest_release_tag_sha=$(curl -s https://api.github.com/repos/netcracker/qubership-test-pipelines/git/ref/tags/${latest_release_tag} | jq -r '.object.sha') + echo "latest_release_tag=${latest_release_tag}" >> $GITHUB_ENV + echo "latest_release_tag_sha=${latest_release_tag_sha}" >> $GITHUB_ENV + - name: checkout + uses: actions/checkout@v6 + with: + ref: main + persist-credentials: true + token: ${{ secrets.GH_ACCESS_TOKEN }} + - name: Update version + env: + GH_TOKEN: ${{ github.token }} + run: | + git config --global user.email "github-actions[bot]@qubership.com" + git config --global user.name "Git Hub Actions [Bot]" + for f in $(grep -rile "^[[:blank:]]*uses: netcracker/qubership-test-pipelines" ./.github/workflows); do + sed -i "s#\(^[[:blank:]]*uses: netcracker/qubership-test-pipelines.*\)@.*#\1@${latest_release_tag_sha} \# ${latest_release_tag}#I" ${f} + sed -i "s#\(^[[:blank:]]*pipeline_branch:\).*#\1 '${latest_release_tag_sha}'#" $f + done + + if [ -n "$(git status --porcelain)" ]; then + echo "✅ Changes detected" + + BRANCH_NAME="feature/bump-test-pipelines-version-$(date +%Y%m%d-%H%M%S)" + + git checkout -b $BRANCH_NAME + git add . + + COMMIT_MESSAGE="chore: bump netcracker/qubership-test-pipelines version to '${latest_release_tag_sha}' [$latest_release_tag]" + + git commit -m "$COMMIT_MESSAGE" + git push origin $BRANCH_NAME + + echo "✅ The newbranch $BRANCH_NAME created and pushed" + + # Create Pull Request + gh pr create --base main --head $BRANCH_NAME --title "chore: bump netcracker/qubership-test-pipelines version" --body "$COMMIT_MESSAGE" + echo "✅ Pull Request created" + else + echo "❌ No changes." + fi From e1510a732874848a8629fedbae09c04195380445 Mon Sep 17 00:00:00 2001 From: borislavr Date: Mon, 30 Mar 2026 07:47:32 +0000 Subject: [PATCH 2/2] feat(ci): added new workflow to bump test-workflows version related issue https://github.com/Netcracker/qubership-workflow-hub/issues/682 --- .github/workflows/bump-test-workflows-version.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-test-workflows-version.yaml b/.github/workflows/bump-test-workflows-version.yaml index eaf338a2..0c831156 100644 --- a/.github/workflows/bump-test-workflows-version.yaml +++ b/.github/workflows/bump-test-workflows-version.yaml @@ -18,7 +18,7 @@ jobs: echo "latest_release_tag=${latest_release_tag}" >> $GITHUB_ENV echo "latest_release_tag_sha=${latest_release_tag_sha}" >> $GITHUB_ENV - name: checkout - uses: actions/checkout@v6 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: main persist-credentials: true @@ -29,6 +29,7 @@ jobs: run: | git config --global user.email "github-actions[bot]@qubership.com" git config --global user.name "Git Hub Actions [Bot]" + # shellcheck disable=2013 for f in $(grep -rile "^[[:blank:]]*uses: netcracker/qubership-test-pipelines" ./.github/workflows); do sed -i "s#\(^[[:blank:]]*uses: netcracker/qubership-test-pipelines.*\)@.*#\1@${latest_release_tag_sha} \# ${latest_release_tag}#I" ${f} sed -i "s#\(^[[:blank:]]*pipeline_branch:\).*#\1 '${latest_release_tag_sha}'#" $f