diff --git a/.github/workflows/generate-linter.yml b/.github/workflows/generate-linter.yml index ae2fe55d..e62c621f 100644 --- a/.github/workflows/generate-linter.yml +++ b/.github/workflows/generate-linter.yml @@ -15,7 +15,6 @@ jobs: go-version: "1.20" - name: Install Dependencies run: go mod download - framework_matrix: needs: install_dependencies strategy: @@ -27,6 +26,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Commit report + run: | + git config --global user.name 'testname' + git config --global user.email 'testemail@users.noreply.github.com' - name: build templates run: script -q /dev/null -c "go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{matrix.driver}}" /dev/null - name: golangci-lint diff --git a/cmd/program/program.go b/cmd/program/program.go index 39a83b33..7ae3dc4a 100644 --- a/cmd/program/program.go +++ b/cmd/program/program.go @@ -431,6 +431,20 @@ func (p *Project) CreateMainFile() error { cobra.CheckErr(err) } + // Git add files + err = utils.ExecuteCmd("git", []string{"add", "."}, projectPath) + if err != nil { + log.Printf("Error adding files to git repo: %v", err) + cobra.CheckErr(err) + return err + } + // Git commit files + err = utils.ExecuteCmd("git", []string{"commit", "-m", "Initial commit"}, projectPath) + if err != nil { + log.Printf("Error committing files to git repo: %v", err) + cobra.CheckErr(err) + return err + } return nil }