-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: add sdk autoupdates * fix: commit and message * fix: make commit lint happy * Update .github/workflows/update-sdk.yml * Update scripts/update-sdk.sh
- Loading branch information
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Update SDK | ||
on: | ||
schedule: | ||
- cron: 30 8 * * TUE | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-sdk: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: update | ||
run: | | ||
go install github.com/icholy/gomajor@latest | ||
make update-atlas-sdk | ||
- name: Verify Changed files | ||
uses: tj-actions/verify-changed-files@78dc414e915e0664bcf0d2b42465a86cd47bcc3c | ||
id: verify-changed-files | ||
with: | ||
files: | | ||
./internal/**/* | ||
- uses: peter-evans/create-pull-request@v5 | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
|
||
with: | ||
title: "chore: atlas GO sdk update" | ||
commit-message: "build(deps): bump go.mongodb.org/atlas-sdk" | ||
delete-branch: true | ||
branch: atlas-sdk-update | ||
body: | | ||
Automatic update for MongoDB Atlas Go Client SDK |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,4 @@ link-git-hooks: ## Install git hooks | |
|
||
.PHONY: update-atlas-sdk | ||
update-atlas-sdk: ## Update the atlas-sdk dependency | ||
go install github.com/icholy/[email protected] | ||
## Fetch the latest major version and update imports. | ||
gomajor get go.mongodb.org/atlas-sdk/v20231001001@latest | ||
./scripts/update-sdk.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
LATEST_SDK_RELEASE=$(curl -sSfL -X GET https://api.github.com/repos/mongodb/atlas-sdk-go/releases/latest | jq -r '.tag_name' | cut -d '.' -f 1) | ||
echo "==> Updating SDK to latest major version $LATEST_SDK_RELEASE" | ||
gomajor get "go.mongodb.org/atlas-sdk/$LATEST_SDK_RELEASE@latest" | ||
go mod tidy | ||
echo "Finished update" |