diff --git a/.github/workflows/combine-schema.v3.2.yml b/.github/workflows/combine-schema.v3.2.yml index fa7fa25..5c91e36 100644 --- a/.github/workflows/combine-schema.v3.2.yml +++ b/.github/workflows/combine-schema.v3.2.yml @@ -83,6 +83,21 @@ jobs: draft: false delete-branch: true + - name: Wait for PR to be mergeable + run: | + echo "Waiting for PR to be mergeable..." + for i in {1..30}; do + MERGEABLE=$(gh pr view ${{ steps.create-pull-request.outputs.pull-request-url }} --json mergeable --jq .mergeable) + echo "MERGEABLE = $MERGEABLE" + if [[ "$MERGEABLE" == "MERGEABLE" || "$MERGEABLE" == "mergeable" ]]; then + break + fi + echo "Still not mergeable, retrying in 10s... ($i/30)" + sleep 10 + done + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Enable automerge uses: "peter-evans/enable-pull-request-automerge@v3" with: diff --git a/.github/workflows/validate-xml.v3.2.yml b/.github/workflows/validate-xml.v3.2.yml index bc2facf..3390e66 100644 --- a/.github/workflows/validate-xml.v3.2.yml +++ b/.github/workflows/validate-xml.v3.2.yml @@ -22,14 +22,34 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Check if files in 3.2 changed + id: changes + run: | + git fetch origin main + CHANGED=$(git diff --name-only origin/main...HEAD | grep '^3.2/' || true) + if [ -z "$CHANGED" ]; then + echo "skip=true" >> $GITHUB_OUTPUT + else + echo "skip=false" >> $GITHUB_OUTPUT + fi - name: Prepare Python environment + if: steps.changes.outputs.skip == 'false' uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install XML validation dependencies + if: steps.changes.outputs.skip == 'false' run: pip install -r scripts/requirements.txt - name: Validate XML datamodel against schema + if: steps.changes.outputs.skip == 'false' run: python scripts/validate_xml.py $XSD_PATH $XML_PATH + + - name: Skip validation (no relevant changes) + if: steps.changes.outputs.skip == 'true' + run: echo "No relevant changes in /3.2. Skipping validation."