feat(sdk): automated oas update #176
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: Bump Version | |
on: | |
pull_request: | |
branches: | |
- '*' | |
types: | |
- labeled | |
- unlabeled | |
permissions: | |
contents: read | |
jobs: | |
check-semver-label: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
pull-requests: write | |
steps: | |
- uses: mheap/github-action-required-labels@388fd6af37b34cdfe5a23b37060e763217e58b03 # v5.5 | |
if: github.actor != 'dependabot[bot]' | |
with: | |
mode: exactly | |
count: 1 | |
labels: "patch, minor, major" | |
bump-version: | |
needs: | |
- check-semver-label | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Install Speakeasy | |
uses: mheap/setup-go-cli@fa9b01cdd4115eac636164f0de43bf7d51c82697 # v1.2.2 | |
with: | |
owner: speakeasy-api | |
repo: speakeasy | |
cli_name: speakeasy | |
package_type: zip | |
version: 1.523.2 # renovate: datasource=github-releases depName=speakeasy-api/speakeasy | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
token: ${{ secrets.PAT }} | |
- name: Reset .speakeasy/gen.yaml to the version on main | |
run: | | |
git fetch origin main | |
git checkout origin/main .speakeasy/gen.yaml .speakeasy/gen.lock | |
- name: Set bump (patch) | |
run: | | |
BUMP_TYPE=$(echo '${{ toJson(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -E 'patch|minor|major') | |
speakeasy bump $BUMP_TYPE | |
- name: Commit SDK changes to the PR | |
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 | |
with: | |
add: . | |
default_author: github_actor | |
message: Bump .speakeasy/gen.yaml based on label |