forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add workflow for tagging essential modified files (qmk#7384)
* Add workflow for tagging essential modified files * Update inline with recent actions * align rules to labeler * Update .github/workflows/auto_tag.yaml
- Loading branch information
Showing
2 changed files
with
32 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Essential files modified | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- quantum/**/* | ||
- tmk_core/**/* | ||
- drivers/**/* | ||
- tests/**/* | ||
- util/**/* | ||
- platforms/**/* | ||
- Makefile | ||
- '*.mk' | ||
|
||
jobs: | ||
tag: | ||
runs-on: ubuntu-latest | ||
|
||
# protect against those who develop with their fork on master | ||
if: github.repository == 'qmk/qmk_firmware' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Bump version and push tag | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,30 +17,8 @@ git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} '*.c' '*.h' | |
git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add | ||
git commit -m "format code according to conventions [skip ci]" && git push [email protected]:qmk/qmk_firmware.git master | ||
|
||
increment_version () | ||
{ | ||
declare -a part=( ${1//\./ } ) | ||
part[2]=$((part[2] + 1)) | ||
new="${part[*]}" | ||
echo -e "${new// /.}" | ||
} | ||
|
||
git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | ||
|
||
NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | grep -Ev '^(docs/)' | grep -Ev '^(users/)' | grep -Ev '^(layouts/)' | wc -l) | ||
if [[ $NEFM -gt 0 ]] ; then | ||
echo "Essential files modified." | ||
git fetch --tags | ||
lasttag=$(git tag --sort=-creatordate --no-column --list '*.*.*' | grep -E -m1 '^[0-9]+\.[0-9]+\.[0-9]+$') | ||
newtag=$(increment_version $lasttag) | ||
until git tag $newtag; do | ||
newtag=$(increment_version $newtag) | ||
done | ||
git push --tags [email protected]:qmk/qmk_firmware.git | ||
else | ||
echo "No essential files modified." | ||
fi | ||
|
||
if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then | ||
make generate-keyboards-file SILENT=true > .keyboards | ||
cd .. | ||
|