feat: support short-circuiting append operations when there are multi… #9
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 Submodule Dependencies | |
| on: | |
| push: | |
| branches: [main] | |
| # Only run if changes affect the root module (not submodules themselves) | |
| paths-ignore: | |
| - "cmd/openapi/**" | |
| - "openapi/linter/customrules/**" | |
| - "openapi/linter/converter/tests/**" | |
| - ".github/workflows/update-submodule-dependencies.yaml" | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-dependencies: | |
| name: Update submodule dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: "go.work" | |
| cache: false # Disable caching to ensure fresh dependency resolution | |
| - name: Update openapi/linter/customrules go.mod | |
| run: | | |
| cd openapi/linter/customrules | |
| # Update to latest main commit | |
| go get github.com/speakeasy-api/openapi@main | |
| go mod tidy | |
| - name: Update openapi/linter/converter/tests go.mod | |
| run: | | |
| cd openapi/linter/converter/tests | |
| # Update to latest main commit (both main module and customrules) | |
| go get github.com/speakeasy-api/openapi@main | |
| go get github.com/speakeasy-api/openapi/openapi/linter/customrules@main | |
| go mod tidy | |
| - name: Update cmd/openapi go.mod | |
| run: | | |
| cd cmd/openapi | |
| # Update to latest main commit (both main module and customrules) | |
| go get github.com/speakeasy-api/openapi@main | |
| go get github.com/speakeasy-api/openapi/openapi/linter/customrules@main | |
| go mod tidy | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| CHANGED_FILES="" | |
| # Check customrules module | |
| if ! git diff --quiet openapi/linter/customrules/go.mod openapi/linter/customrules/go.sum 2>/dev/null; then | |
| CHANGED_FILES="${CHANGED_FILES}customrules " | |
| fi | |
| # Check converter/tests module | |
| if ! git diff --quiet openapi/linter/converter/tests/go.mod openapi/linter/converter/tests/go.sum 2>/dev/null; then | |
| CHANGED_FILES="${CHANGED_FILES}converter-tests " | |
| fi | |
| # Check cmd/openapi module | |
| if ! git diff --quiet cmd/openapi/go.mod cmd/openapi/go.sum 2>/dev/null; then | |
| CHANGED_FILES="${CHANGED_FILES}cmd " | |
| fi | |
| if [ -z "$CHANGED_FILES" ]; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| echo "No changes detected" | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| echo "modules=${CHANGED_FILES}" >> $GITHUB_OUTPUT | |
| echo "Changes detected in: ${CHANGED_FILES}" | |
| # Get the new version for the PR description | |
| NEW_VERSION=$(grep 'github.com/speakeasy-api/openapi v' cmd/openapi/go.mod | head -1 | awk '{print $2}') | |
| echo "version=${NEW_VERSION}" >> $GITHUB_OUTPUT | |
| echo "Updated to version: ${NEW_VERSION}" | |
| fi | |
| - name: Create Pull Request | |
| if: steps.changes.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: | | |
| chore: update submodule dependencies to latest main | |
| Updates go.mod files in submodules to use the latest commit from main. | |
| Version: ${{ steps.changes.outputs.version }} | |
| Updated modules: ${{ steps.changes.outputs.modules }} | |
| branch: bot/update-submodule-dependencies | |
| delete-branch: true | |
| title: "chore: update submodule dependencies to latest main" | |
| body: | | |
| ## Updates submodule dependencies | |
| This PR updates the `go.mod` files in submodules to reference the latest commit from main. | |
| **Updated to:** `${{ steps.changes.outputs.version }}` | |
| **Updated modules:** ${{ steps.changes.outputs.modules }} | |
| **Changes:** | |
| - Updated `github.com/speakeasy-api/openapi` dependency in submodule go.mod files | |
| - Ran `go mod tidy` to update dependencies | |
| --- | |
| *This PR was automatically created by the [update-submodule-dependencies workflow](.github/workflows/update-submodule-dependencies.yaml)* | |
| labels: | | |
| dependencies | |
| automated | |
| - name: Summary | |
| run: | | |
| if [ "${{ steps.changes.outputs.changed }}" == "true" ]; then | |
| echo "✅ Pull request created to update submodule dependencies" | |
| echo "Version: ${{ steps.changes.outputs.version }}" | |
| echo "Modules: ${{ steps.changes.outputs.modules }}" | |
| else | |
| echo "ℹ️ No changes needed - submodule dependencies already up to date" | |
| fi |