test #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update SDK | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - chore/CD-pull-based-sdk-update | |
| workflow_dispatch: | |
| env: | |
| GO_VERSION: "1.25" | |
| JAVA_VERSION: "25" | |
| jobs: | |
| update-sdk: | |
| name: "Update SDK Repo" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: Install Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Checkout SDK generator | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: "stackitcloud/stackit-sdk-generator" | |
| - name: Install project tools and dependencies | |
| shell: bash | |
| run: make project-tools | |
| - name: Download OAS | |
| shell: bash | |
| run: make download-oas | |
| - name: Generate SDK | |
| shell: bash | |
| run: make generate-go-sdk | |
| - name: Push SDK | |
| env: | |
| # auth | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| #GH_TOKEN: ${{ secrets.RENOVATE_TOKEN }} | |
| # variables | |
| BRANCH_PREFIX: "generator-bot-${{ github.run_id }}" | |
| COMMIT_INFO: "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" | |
| REPO_URL: "https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${{ github.repository }}.git" | |
| run: scripts/sdk-create-pr.sh "$BRANCH_PREFIX" "$COMMIT_INFO" "$REPO_URL" | |