Skip to content

Commit a94c476

Browse files
authored
Merge pull request #2 from stacktodate/dogfood
Dogfood
2 parents 609d2b9 + b32c8eb commit a94c476

File tree

5 files changed

+49
-5
lines changed

5 files changed

+49
-5
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Sync Stack To Date
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
7+
jobs:
8+
sync-stacktodate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up Go
14+
uses: actions/setup-go@v4
15+
with:
16+
go-version: '1.25'
17+
18+
- name: Download dependencies
19+
run: go mod download
20+
21+
- name: Build stacktodate
22+
run: go build -o stacktodate
23+
24+
- name: Check stacktodate config
25+
run: ./stacktodate check
26+
27+
- name: Push stacktodate config
28+
run: ./stacktodate push
29+
env:
30+
STD_TOKEN: ${{ secrets.STD_TOKEN }}

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ jobs:
2626

2727
- name: Run tests
2828
run: go test -v ./...
29+
30+
- name: Build stacktodate
31+
run: go build -o stacktodate
32+
33+
- name: Check stacktodate config
34+
run: ./stacktodate check

cmd/check.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ var checkCmd = &cobra.Command{
4444
Short: "Check if detected versions match stacktodate.yml",
4545
Long: `Verify that the versions in stacktodate.yml match the currently detected versions in your project. Useful for CI/CD pipelines.`,
4646
Run: func(cmd *cobra.Command, args []string) {
47+
// Use default config file if not specified
48+
if checkConfigFile == "" {
49+
checkConfigFile = "stacktodate.yml"
50+
}
51+
4752
// Load config without requiring UUID
4853
config, err := helpers.LoadConfig(checkConfigFile)
4954
if err != nil {
@@ -53,11 +58,7 @@ var checkCmd = &cobra.Command{
5358
// Resolve absolute path for directory management
5459
absConfigPath, err := helpers.ResolveAbsPath(checkConfigFile)
5560
if err != nil {
56-
if checkConfigFile == "" {
57-
absConfigPath, _ = helpers.ResolveAbsPath("stacktodate.yml")
58-
} else {
59-
helpers.ExitOnError(err, "failed to resolve config path")
60-
}
61+
helpers.ExitOnError(err, "failed to resolve config path")
6162
}
6263

6364
// Get config directory

cmd/update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ var updateCmd = &cobra.Command{
8787
var updateConfigFile string
8888

8989
func init() {
90+
rootCmd.AddCommand(updateCmd)
9091
// Flags for update command
9192
updateCmd.Flags().StringVarP(&updateConfigFile, "config", "c", "stacktodate.yml", "Path to stacktodate.yml config file (default: stacktodate.yml)")
9293
updateCmd.Flags().BoolVar(&skipAutodetect, "skip-autodetect", false, "Skip autodetection of project technologies")

stacktodate.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
uuid: 1fe0b376-1df7-4848-bf2d-525acdce6b82
2+
name: stacktodate-cli
3+
stack:
4+
go:
5+
version: "1.25"
6+
source: go.mod

0 commit comments

Comments
 (0)