Skip to content

Commit

Permalink
fix: Fixes Update SDK GitHub action (#1596)
Browse files Browse the repository at this point in the history
* include all changed files

* install gomajor from make tools

* allow to use SDK Preview

* use Token so CI checks are run

* fix sdk preview script

* Update verify-changed-files to a commit version

Co-authored-by: Wojciech Trocki <[email protected]>

* Update text in  scripts/update-sdk-preview.sh

Co-authored-by: Wojciech Trocki <[email protected]>

* change doc

* remove preview

* more descriptive action name

---------

Co-authored-by: Wojciech Trocki <[email protected]>
  • Loading branch information
lantoli and wtrocki authored Nov 6, 2023
1 parent 936e092 commit 0193f4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/update-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Update SDK
name: Update Atlas Go SDK
on:
schedule:
- cron: 30 8 * * TUE
- cron: "30 8 * * TUE" # Every Tuesday at 8:30 AM
workflow_dispatch:

jobs:
Expand All @@ -13,23 +13,18 @@ jobs:
- 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: Update files
run: make tools update-atlas-sdk
- name: Verify Changed files
uses: tj-actions/verify-changed-files@6d688963a73d28584e163b6f62cf927a282c4d11
id: verify-changed-files
with:
files: |
./internal/**/*
- uses: peter-evans/create-pull-request@v5
- name: Create PR
uses: peter-evans/create-pull-request@v5
if: steps.verify-changed-files.outputs.files_changed == 'true'

with:
title: "chore: atlas GO sdk update"
title: "chore: Updates Atlas Go SDK"
token: ${{ secrets.TOKEN_TO_OPEN_PR }}
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
body: Automatic update for MongoDB Atlas Go Client SDK
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ lint:
.PHONY: tools
tools: ## Install dev tools
@echo "==> Installing dependencies..."
go install github.com/icholy/gomajor@latest
go install github.com/client9/misspell/cmd/misspell@latest
go install github.com/terraform-linters/[email protected]
go install github.com/rhysd/actionlint/cmd/actionlint@latest
Expand Down Expand Up @@ -138,3 +139,4 @@ link-git-hooks: ## Install git hooks
.PHONY: update-atlas-sdk
update-atlas-sdk: ## Update the atlas-sdk dependency
./scripts/update-sdk.sh

0 comments on commit 0193f4c

Please sign in to comment.