From 2e07af1646f7288808b651068ef0843ed93d3801 Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:52:51 +0100 Subject: [PATCH 1/9] Limit workflow to pull request on main branch --- .github/workflows/check_version.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index f15f65cba..6860021eb 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -1,6 +1,9 @@ # Checks if version number has been updated name: Version Check -on: pull_request +on: + pull_request: + branches: + - main jobs: lint: From 93298d71f37f007209e21bd2d09fb3a956d60bca Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:31:51 +0100 Subject: [PATCH 2/9] Try to fix workflow again --- .github/scripts/check_schema_version.sh | 4 +++- .github/workflows/check_version.yml | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/scripts/check_schema_version.sh b/.github/scripts/check_schema_version.sh index 819aea80e..ef95190d4 100755 --- a/.github/scripts/check_schema_version.sh +++ b/.github/scripts/check_schema_version.sh @@ -3,8 +3,10 @@ PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) ONTOLOGY_VERSION=$(mvn help:evaluate -Dexpression=ontology.version -q -DforceStdout) +git fetch > /dev/null 2>&1 + # Check for changes and compare versions -if git diff --quiet "main:$(git ls-tree -r --name-only main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then +if git diff --quiet "origin/main:$(git ls-tree -r --name-only main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then DIFF_STATUS=0 else DIFF_STATUS=1 diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index 6860021eb..f15f65cba 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -1,9 +1,6 @@ # Checks if version number has been updated name: Version Check -on: - pull_request: - branches: - - main +on: pull_request jobs: lint: From c4c8619f5952f5de0e8bec8e5ca930d6b017154d Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:34:06 +0100 Subject: [PATCH 3/9] Trigger workflow --- .github/workflows/check_version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index f15f65cba..e3f998d19 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -1,7 +1,7 @@ # Checks if version number has been updated name: Version Check on: pull_request - +# on: push jobs: lint: name: Release Tag existence Check From ae151c6b803381606e78f797c930d31bdc39ba95 Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:36:39 +0100 Subject: [PATCH 4/9] Do git fetch before checking available git tag --- .github/scripts/tagcheck.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/scripts/tagcheck.sh b/.github/scripts/tagcheck.sh index 260f70bfa..8827e0f9e 100755 --- a/.github/scripts/tagcheck.sh +++ b/.github/scripts/tagcheck.sh @@ -1,5 +1,7 @@ #!/bin/sh +git fetch > /dev/null 2>&1 + if git rev-parse "$1" >/dev/null 2>&1; then echo "Tag $1 exist - update version in pom!" exit 1 From 0ec3f3381409685b690713efb8d4cb685c20ba9f Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:38:07 +0100 Subject: [PATCH 5/9] Workflow test --- .github/workflows/check_version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index f15f65cba..adbf3de1c 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -8,5 +8,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: .github/scripts/tagcheck.sh v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + # - run: .github/scripts/tagcheck.sh v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - run: .github/scripts/check_schema_version.sh \ No newline at end of file From 447988670578e5316dfa7f90a8fe242411d3caff Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:40:12 +0100 Subject: [PATCH 6/9] Try git fetch --all --- .github/scripts/check_schema_version.sh | 2 +- .github/scripts/tagcheck.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/check_schema_version.sh b/.github/scripts/check_schema_version.sh index ef95190d4..fe683ba02 100755 --- a/.github/scripts/check_schema_version.sh +++ b/.github/scripts/check_schema_version.sh @@ -3,7 +3,7 @@ PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) ONTOLOGY_VERSION=$(mvn help:evaluate -Dexpression=ontology.version -q -DforceStdout) -git fetch > /dev/null 2>&1 +git fetch --all > /dev/null 2>&1 # Check for changes and compare versions if git diff --quiet "origin/main:$(git ls-tree -r --name-only main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then diff --git a/.github/scripts/tagcheck.sh b/.github/scripts/tagcheck.sh index 8827e0f9e..196445e5a 100755 --- a/.github/scripts/tagcheck.sh +++ b/.github/scripts/tagcheck.sh @@ -1,6 +1,6 @@ #!/bin/sh -git fetch > /dev/null 2>&1 +git fetch --all > /dev/null 2>&1 if git rev-parse "$1" >/dev/null 2>&1; then echo "Tag $1 exist - update version in pom!" From 4188a8d6fd429f87c1f1fdc2ff07327056721665 Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:44:22 +0100 Subject: [PATCH 7/9] Try fix --- .github/scripts/check_schema_version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/check_schema_version.sh b/.github/scripts/check_schema_version.sh index fe683ba02..ce78bb41a 100755 --- a/.github/scripts/check_schema_version.sh +++ b/.github/scripts/check_schema_version.sh @@ -3,7 +3,7 @@ PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) ONTOLOGY_VERSION=$(mvn help:evaluate -Dexpression=ontology.version -q -DforceStdout) -git fetch --all > /dev/null 2>&1 +git fetch --all # Check for changes and compare versions if git diff --quiet "origin/main:$(git ls-tree -r --name-only main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then From f55163ea066b06f8abaa4fc42a5336afea86f72c Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:46:33 +0100 Subject: [PATCH 8/9] Try fix 2 --- .github/scripts/check_schema_version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/check_schema_version.sh b/.github/scripts/check_schema_version.sh index ce78bb41a..918adcb03 100755 --- a/.github/scripts/check_schema_version.sh +++ b/.github/scripts/check_schema_version.sh @@ -6,7 +6,7 @@ ONTOLOGY_VERSION=$(mvn help:evaluate -Dexpression=ontology.version -q -DforceStd git fetch --all # Check for changes and compare versions -if git diff --quiet "origin/main:$(git ls-tree -r --name-only main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then +if git diff --quiet "origin/main:$(git ls-tree -r --name-only origin/main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then DIFF_STATUS=0 else DIFF_STATUS=1 From 6b4bbbc87143a957f8e63e36659e7dcfc68cb8b2 Mon Sep 17 00:00:00 2001 From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:47:59 +0100 Subject: [PATCH 9/9] Cleanup --- .github/scripts/check_schema_version.sh | 2 +- .github/workflows/check_version.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/scripts/check_schema_version.sh b/.github/scripts/check_schema_version.sh index 918adcb03..9d450cca3 100755 --- a/.github/scripts/check_schema_version.sh +++ b/.github/scripts/check_schema_version.sh @@ -3,7 +3,7 @@ PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) ONTOLOGY_VERSION=$(mvn help:evaluate -Dexpression=ontology.version -q -DforceStdout) -git fetch --all +git fetch --all > /dev/null 2>&1 # Check for changes and compare versions if git diff --quiet "origin/main:$(git ls-tree -r --name-only origin/main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index adbf3de1c..6860021eb 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -1,6 +1,9 @@ # Checks if version number has been updated name: Version Check -on: pull_request +on: + pull_request: + branches: + - main jobs: lint: @@ -8,5 +11,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # - run: .github/scripts/tagcheck.sh v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + - run: .github/scripts/tagcheck.sh v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - run: .github/scripts/check_schema_version.sh \ No newline at end of file