From 384cd0a76f5319a4df2b608435dfcbe6c829175e Mon Sep 17 00:00:00 2001 From: Mateusz Filipowicz Date: Fri, 7 Feb 2025 15:20:58 +0100 Subject: [PATCH] ci: add Unifi version used when updating generated controlled modules to commit and PR messages --- .github/workflows/generate.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 18b703f..be8040a 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -4,16 +4,32 @@ on: - cron: '0 0 * * *' workflow_dispatch: {} +permissions: + contents: write + pull-requests: write + jobs: fields: runs-on: 'ubuntu-latest' steps: - uses: 'actions/checkout@v4' + - uses: 'actions/setup-go@v5' + + - name: "Generate new client structures" + run: 'go generate unifi/fields.go' + + - name: Read Unifi version marker + id: unifi_version + uses: 'juliangruber/read-file-action@v1' + with: + path: ./unifi-version + trim: 'true' + # TODO: Automatically merge the PR if tests pass. - - run: 'go generate unifi/fields.go' - uses: 'peter-evans/create-pull-request@v7' with: delete-branch: true - title: 'Update to latest controller version' + title: 'feat: update to the controller version ${{ steps.unifi_version.outputs.content }}' + commit-message: 'feat: update to the controller version ${{ steps.unifi_version.outputs.content }}'