diff --git a/.github/workflows/generate-release-notes.yml b/.github/workflows/generate-release-notes.yml new file mode 100644 index 00000000000..369403d0c9f --- /dev/null +++ b/.github/workflows/generate-release-notes.yml @@ -0,0 +1,50 @@ +name: generate release notes +on: + pull_request: + types: [opened, synchronize] + paths: + - "**/src/*.yml" + - "**/src/*.yaml" +jobs: + release-notes: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + path: content + sparse-checkout: | + advocacy_docs + product_docs + + - name: Checkout relgen tool + uses: actions/checkout@v4 + with: + ref: develop + path: tools + sparse-checkout: | + tools + + - name: setup node + uses: actions/setup-node@v4 + + - name: install dependencies + run: npm --prefix ./tools/tools/automation/generators/relgen ci + + # TODO: limit this to paths that have actually *changed* + - name: regenerate relnotes + run: | + shopt -s globstar + for rnmetapath in ./content/**/src/meta.yml; do + ./tools/tools/automation/generators/relgen/relgen.js -p ${rnmetapath%/src/meta.yml} + done + + - name: commit modified files + run: | + cd ./content + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "update generated release notes" + git push \ No newline at end of file