From b55e2504ce22e3fd2bcf3cc6d793e5a88351b168 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 15:52:58 +0100 Subject: [PATCH] Improve tagMe for test branch --- .github/workflows/pre-commit.yml | 3 ++- README.md | 2 +- tagMe | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 02b28d6..e35ba31 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -10,6 +10,7 @@ jobs: LOG_TO_CS: ./logToCs.py RAW_LOG: pre-commit.log CS_XML: pre-commit.xml + SKIP: no-commit-to-branch steps: - run: sudo apt-get update && sudo apt-get install cppcheck if: false @@ -36,7 +37,7 @@ jobs: run: | python ${LOG_TO_CS} ${RAW_LOG} ${CS_XML} - name: Convert Raw Log to Checkstyle format (launch action) - uses: mdeweerd/.3.2 + uses: mdeweerd/logToCheckStyle@2024.3.2 if: ${{ failure() }} with: in: ${{ env.RAW_LOG }} diff --git a/README.md b/README.md index e65e692..3f92101 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ optional arguments: ```yaml - name: Convert Raw Log to Checkstyle format (launch action) - uses: mdeweerd/.3.2 + uses: mdeweerd/logToCheckStyle@2024.3.2 if: ${{ failure() }} with: in: ${{ env.RAW_LOG }} diff --git a/tagMe b/tagMe index be6a27b..da82d7f 100644 --- a/tagMe +++ b/tagMe @@ -7,7 +7,7 @@ if [ "$TAG" != "" ] ; then FILES+=( README.md ) fi # Update the version and tag - perl -i -p -e 's/(logToCheckStyle\@).*/$1'"$TAG"'/' "${FILES[@]}" \ + perl -i -p -e 's/(?<=logToCheckStyle\@).*/'"$TAG"'/' "${FILES[@]}" \ && git add "${FILES[@]}" \ && git commit --no-verify --fixup HEAD \ && git rebase --no-verify -i --autosquash HEAD~2 @@ -19,7 +19,9 @@ grep "$TAG" README.md \ sourceBranch=$(git symbolic-ref HEAD | cut -d "/" -f 3-); targetBranch="test_branch"; git checkout $targetBranch \ + && git pull \ + && perl -i -p -e 's/(?<=logToCheckStyle\@).*/'"$TAG"'/' "${FILES[@]}" \ && git rebase --onto $sourceBranch \ - && git push \ + && git push -f \ && git checkout $sourceBranch fi