Skip to content

Commit

Permalink
Changes git stage all to only stage AssemblyInfo
Browse files Browse the repository at this point in the history
Git stage all can accidentally include unintended changes into a release commit. This change explicitly instructs Git to only stage the CHANGELOG and the AssemblyInfo.

Resolves #187
  • Loading branch information
Mike Miller committed Mar 7, 2020
1 parent 0dd3f2f commit ecebec3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Content/Console/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,12 @@ let gitRelease _ =

let releaseNotesGitCommitFormat = latestEntry.ToString()

Git.Staging.stageAll ""
Git.Staging.stageFile "" "CHANGELOG.md"
|> ignore

!! "src/**/AssemblyInfo.fs"
|> Seq.iter (Git.Staging.stageFile "" >> ignore)

Git.Commit.exec "" (sprintf "Bump version to %s\n\n%s" latestEntry.NuGetVersion releaseNotesGitCommitFormat)
Git.Branches.push ""

Expand Down
7 changes: 6 additions & 1 deletion Content/Library/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,12 @@ let gitRelease _ =

let releaseNotesGitCommitFormat = latestEntry.ToString()

Git.Staging.stageAll ""
Git.Staging.stageFile "" "CHANGELOG.md"
|> ignore

!! "src/**/AssemblyInfo.fs"
|> Seq.iter (Git.Staging.stageFile "" >> ignore)

Git.Commit.exec "" (sprintf "Bump version to %s\n\n%s" latestEntry.NuGetVersion releaseNotesGitCommitFormat)
Git.Branches.push ""

Expand Down
7 changes: 6 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,12 @@ let ``git release`` _ =

let releaseNotesGitCommitFormat = latestEntry.ToString()

Git.Staging.stageAll ""
Git.Staging.stageFile "" "CHANGELOG.md"
|> ignore

!! "Content/**/AssemblyInfo.fs"
|> Seq.iter (Git.Staging.stageFile "" >> ignore)

Git.Commit.exec "" (sprintf "Bump version to %s\n\n%s" latestEntry.NuGetVersion releaseNotesGitCommitFormat)
Git.Branches.push ""

Expand Down

0 comments on commit ecebec3

Please sign in to comment.