Skip to content

Commit

Permalink
Improve tagMe for test branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Mar 18, 2024
1 parent 09fb4c6 commit efa4d39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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@v2024.3.2
if: ${{ failure() }}
with:
in: ${{ env.RAW_LOG }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ optional arguments:
```yaml
- name: Convert Raw Log to Checkstyle format (launch action)
uses: mdeweerd/.3.2
uses: mdeweerd/logToCheckStyle@v2024.3.2
if: ${{ failure() }}
with:
in: ${{ env.RAW_LOG }}
Expand Down
6 changes: 4 additions & 2 deletions tagMe
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit efa4d39

Please sign in to comment.