Skip to content

Commit 76b7093

Browse files
authored
Merge pull request #91 from rudnerbjoern/dev
Enhance GitHub workflows
2 parents 7208b89 + 26ff614 commit 76b7093

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/combine-schema.v3.2.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,21 @@ jobs:
8383
draft: false
8484
delete-branch: true
8585

86+
- name: Wait for PR to be mergeable
87+
run: |
88+
echo "Waiting for PR to be mergeable..."
89+
for i in {1..30}; do
90+
MERGEABLE=$(gh pr view ${{ steps.create-pull-request.outputs.pull-request-url }} --json mergeable --jq .mergeable)
91+
echo "MERGEABLE = $MERGEABLE"
92+
if [[ "$MERGEABLE" == "MERGEABLE" || "$MERGEABLE" == "mergeable" ]]; then
93+
break
94+
fi
95+
echo "Still not mergeable, retrying in 10s... ($i/30)"
96+
sleep 10
97+
done
98+
env:
99+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
86101
- name: Enable automerge
87102
uses: "peter-evans/enable-pull-request-automerge@v3"
88103
with:

.github/workflows/validate-xml.v3.2.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,34 @@ jobs:
2222
steps:
2323
- name: Check out repository
2424
uses: actions/checkout@v3
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Check if files in 3.2 changed
29+
id: changes
30+
run: |
31+
git fetch origin main
32+
CHANGED=$(git diff --name-only origin/main...HEAD | grep '^3.2/' || true)
33+
if [ -z "$CHANGED" ]; then
34+
echo "skip=true" >> $GITHUB_OUTPUT
35+
else
36+
echo "skip=false" >> $GITHUB_OUTPUT
37+
fi
2538
2639
- name: Prepare Python environment
40+
if: steps.changes.outputs.skip == 'false'
2741
uses: actions/setup-python@v5
2842
with:
2943
python-version: '3.x'
3044

3145
- name: Install XML validation dependencies
46+
if: steps.changes.outputs.skip == 'false'
3247
run: pip install -r scripts/requirements.txt
3348

3449
- name: Validate XML datamodel against schema
50+
if: steps.changes.outputs.skip == 'false'
3551
run: python scripts/validate_xml.py $XSD_PATH $XML_PATH
52+
53+
- name: Skip validation (no relevant changes)
54+
if: steps.changes.outputs.skip == 'true'
55+
run: echo "No relevant changes in /3.2. Skipping validation."

0 commit comments

Comments
 (0)