Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/line-length.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate I-D line length
name: Validate I-Ds line length
on:
push:
branches:
Expand All @@ -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

2 changes: 1 addition & 1 deletion .github/workflows/oas-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 32 additions & 8 deletions .github/workflows/rfc.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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<<EOF" >> $GITHUB_OUTPUT
cat /tmp/result >> $GITHUB_OUTPUT
Expand All @@ -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
Expand All @@ -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:
```
Expand Down
Loading