From 0241b75f8a167bba8927fbedd5dcbae48368f5d7 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 30 Jan 2024 18:31:50 +0300 Subject: [PATCH] ci: automate version bumps in module README.md files closes #138 --- .github/workflows/update-readme.yaml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/update-readme.yaml diff --git a/.github/workflows/update-readme.yaml b/.github/workflows/update-readme.yaml new file mode 100644 index 0000000..995c021 --- /dev/null +++ b/.github/workflows/update-readme.yaml @@ -0,0 +1,38 @@ +name: Update README on Tag + +on: + push: + tags: + - 'v*' + +jobs: + update-readme: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get the latest tag + id: get-latest-tag + run: echo "TAG=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_OUTPUT + + - name: Run update script + run: ./update-readme.sh + + - name: Create Pull Request + id: create-pr + uses: peter-evans/create-pull-request@v5 + with: + commit-message: 'chore: bump version to ${{ steps.get-latest-tag.outputs.TAG }} in README.md files' + title: 'chore: bump version to ${{ steps.get-latest-tag.outputs.TAG }} in README.md files' + body: 'This is an auto-generated PR to update README.md files of all modules with the new tag ${{ steps.get-latest-tag.outputs.TAG }}' + branch: 'update-readme-branch' + + - name: Auto-approve + uses: hmarr/auto-approve-action@v4 + if: github.ref == 'refs/heads/update-readme-branch'