diff --git a/.github/workflows/workflow-executor.yaml b/.github/workflows/workflow-executor.yaml index faa05ee..1dedeb8 100644 --- a/.github/workflows/workflow-executor.yaml +++ b/.github/workflows/workflow-executor.yaml @@ -168,7 +168,7 @@ jobs: short_circuit_label_trigger: ${{ steps.check-label.outputs.short_circuit_label_trigger }} steps: - name: Check Pull Request Label - if: ${{ github.event_name == 'pull_request' && github.event.action == 'labeled' }} + if: ${{ github.event_name == 'pull_request' && (github.event.action == 'labeled' || github.event.action == 'unlabeled') }} id: check-label continue-on-error: true run: | @@ -178,7 +178,7 @@ jobs: # Check if the label is a valid version bump and ensure the current PR isn't already on that version bump # If either are true we short circuit the rest of the action - if [[ "$label" != "patch" && "$label" != "minor" && "$label" != "major" && "$label" != "graduate" ]] || grep -Fq "Version Bump Type: [$label]" "$tmpfile"; then + if [[ "$label" != "patch" && "$label" != "minor" && "$label" != "major" && "$label" != "graduate" ]] || { [[ "${{ github.event.action }}" == "labeled" ]] && grep -Fq "Version Bump Type: [$label]" "$tmpfile"; }; then echo "No version bump label found in PR body. Short-circuiting." echo "short_circuit_label_trigger=true" >> "$GITHUB_OUTPUT" exit 0 @@ -191,7 +191,7 @@ jobs: - id: run-workflow name: Run Generation Workflow if: ${{ steps.check-label.outputs.short_circuit_label_trigger != 'true' }} - uses: speakeasy-api/sdk-generation-action@v15 + uses: speakeasy-api/sdk-generation-action@v15.32.6 with: speakeasy_version: ${{ inputs.speakeasy_version }} github_access_token: ${{ secrets.github_access_token }} diff --git a/action.yml b/action.yml index 4f1538d..b1fe41e 100644 --- a/action.yml +++ b/action.yml @@ -169,7 +169,7 @@ outputs: description: "The directory the SDK target was generated to" runs: using: "docker" - image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v15" + image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v15.32.6" env: SPEAKEASY_API_KEY: ${{ inputs.speakeasy_api_key }} SPEAKEASY_SERVER_URL: ${{ inputs.speakeasy_server_url }} diff --git a/internal/git/git.go b/internal/git/git.go index 8997fa4..9da7e45 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -28,6 +28,7 @@ import ( "github.com/speakeasy-api/sdk-generation-action/internal/logging" "github.com/speakeasy-api/sdk-generation-action/internal/versionbumps" "github.com/speakeasy-api/sdk-generation-action/pkg/releases" + "github.com/speakeasy-api/versioning-reports/versioning" "github.com/google/go-github/v63/github" "golang.org/x/oauth2" @@ -540,7 +541,7 @@ Based on: body += stripCodes(info.VersioningInfo.VersionReport.GetMarkdownSection()) // We keep track of explicit bump types and whether that bump type is manual or automated in the PR body - if labelBumpType != nil { + if labelBumpType != nil && *labelBumpType != versioning.BumpCustom && *labelBumpType != versioning.BumpNone { // be very careful if changing this it critically aligns with a regex in parseBumpFromPRBody versionBumpMsg := "Version Bump Type: " + fmt.Sprintf("[%s]", string(*labelBumpType)) + " - " if info.VersioningInfo.ManualBump { diff --git a/internal/git/labels.go b/internal/git/labels.go index a73a3d9..79a0d06 100644 --- a/internal/git/labels.go +++ b/internal/git/labels.go @@ -116,7 +116,7 @@ func PRVersionMetadata(m *versioning.MergedVersionReport, labelTypes map[string] singleBumpType := "" singleNewVersion := "" for _, report := range m.Reports { - if len(report.BumpType) > 0 && report.BumpType != versioning.BumpNone && report.BumpType != versioning.BumpCustom { + if len(report.BumpType) > 0 && report.BumpType != versioning.BumpNone { if len(singleBumpType) > 0 { skipBumpType = true } diff --git a/internal/versionbumps/versionBumps.go b/internal/versionbumps/versionBumps.go index 67f08f2..72b5158 100644 --- a/internal/versionbumps/versionBumps.go +++ b/internal/versionbumps/versionBumps.go @@ -23,6 +23,7 @@ var bumpTypeLabels = map[versioning.BumpType]string{ versioning.BumpPatch: "Patch version bump", versioning.BumpGraduate: "Graduate prerelease to stable", versioning.BumpPrerelease: "Bump by a prerelease version", + versioning.BumpCustom: "A custom version was applied", } type VersioningInfo struct {