From ea78b4f00cbc935518cf51fff0fd9d9073a14cba Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Sat, 13 Jun 2026 11:32:05 +0200 Subject: [PATCH] CI fixes and updates --- .github/workflows/line-length.yml | 6 ++--- .github/workflows/oas-validation.yml | 2 +- .github/workflows/rfc.yml | 40 ++++++++++++++++++++++------ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/.github/workflows/line-length.yml b/.github/workflows/line-length.yml index cc28e14..6bb8950 100644 --- a/.github/workflows/line-length.yml +++ b/.github/workflows/line-length.yml @@ -1,4 +1,4 @@ -name: Validate I-D line length +name: Validate I-Ds line length on: push: branches: @@ -11,8 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - - name: Validate I-D line length + - name: Validate line length run: if grep -nhE '.{73,}' IETF-*.md | grep ' '; then echo "Found lines exceeding the limit"; exit -1; else echo "Validation completed successfully"; fi diff --git a/.github/workflows/oas-validation.yml b/.github/workflows/oas-validation.yml index 6261bac..7751221 100644 --- a/.github/workflows/oas-validation.yml +++ b/.github/workflows/oas-validation.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Validate OpenAPI using Swagger CLI uses: mbowman100/swagger-validator-action@2.0 diff --git a/.github/workflows/rfc.yml b/.github/workflows/rfc.yml index 727530c..803c835 100644 --- a/.github/workflows/rfc.yml +++ b/.github/workflows/rfc.yml @@ -1,14 +1,30 @@ -name: Prepare I-D for Datatracker +name: Prepare I-Ds for Datatracker on: workflow_dispatch: + inputs: + bump_OCM: + description: 'Bump version for main OCM I-D' + required: true + type: boolean + default: false + bump_OCM-IP: + description: 'Bump version for OCM-IP I-D' + required: true + type: boolean + default: false + bump_OCM-MLS: + description: 'Bump version for OCM-MLS I-D' + required: true + type: boolean + default: false jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: @@ -18,17 +34,25 @@ jobs: - name: Install kramdown-rfc run: gem install --no-document kramdown-rfc - - name: Bump I-D version + - name: Bump I-D version for the selected Drafts + env: + # Passes checkbox states safely to the shell as a JSON object + ALL_INPUTS: ${{ toJson(inputs) }} run: | - for doc in IETF-*.md; do - git diff --quiet ${doc} || perl -pe 's/(docname: draft.*-)(\d+)/$1 . sprintf("%02d", $2 + 1)/ge' -i ${doc} || exit -1 + for doc in OCM OCM-IP OCM-MLS; do + is_enabled=$(echo "$ALL_INPUTS" | jq -r ".\"bump_${doc}\"") + if [ "$is_enabled" = "true" ]; then + echo "Bumping version in ${doc} I-D" + perl -pe 's/(docname: draft.*-)(\d+)/$1 . sprintf("%02d", $2 + 1)/ge' -i IETF-${doc}.md || exit -1 + fi done - name: Convert Markdown to XML and save output id: convert run: | for doc in IETF-*.md; do - kramdown-rfc ${doc} > ${doc}.xml 2>> /tmp/result || true + kramdown-rfc ${doc} > ${doc/md/xml} 2>> /tmp/result || true + done cat /tmp/result echo "result<> $GITHUB_OUTPUT cat /tmp/result >> $GITHUB_OUTPUT @@ -45,7 +69,7 @@ jobs: path: IETF-*.xml # Create a PR to the repo with the results - - uses: peter-evans/create-pull-request@v6 + - uses: peter-evans/create-pull-request@v8 with: branch: rfc/gen-${{ github.sha }} base: develop @@ -56,7 +80,7 @@ jobs: signoff: true title: 'Regenerate IETF XML files' body: | - This autogenerated PR bumps the IETF version of the I-Ds that were modified, and prepares the xml files for submission to the [IETF Datatracker](https://datatracker.ietf.org/submit). + This autogenerated PR bumps the IETF version of the I-Ds that were selected, and prepares the xml files for submission to the [IETF Datatracker](https://datatracker.ietf.org/submit). The conversion produced the output below: ```