From f2b5d81fc8c501624e3ab33ef6c90d3f5e4b217a Mon Sep 17 00:00:00 2001 From: Josh Heyer Date: Wed, 11 Dec 2024 05:18:55 +0000 Subject: [PATCH] Generate release notes when source files change --- .github/workflows/generate-release-notes.yml | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/generate-release-notes.yml 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