Repository: goreleaser/goreleaser
Pull request #2719 (2021-12-02 18:11:02)

chore: rename yml to yaml in init command
references to #2698

codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2719?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
> Merging [#2719](https://codecov.io/gh/goreleaser/goreleaser/pull/2719?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (29685c6) into [main](https://codecov.io/gh/goreleaser/goreleaser/commit/ecb800aef7723d58f4521d4cb457a972b019ba92?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (ecb800a) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/goreleaser/pull/2719/graphs/tree.svg?width=650&height=150&src=pr&token=3bJvv6b7hN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)](https://codecov.io/gh/goreleaser/goreleaser/pull/2719?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)

```diff
@@           Coverage Diff           @@
##             main    #2719   +/-   ##
=======================================
  Coverage   84.90%   84.90%           
=======================================
  Files         105      105           
  Lines        7901     7901           
=======================================
  Hits         6708     6708           
  Misses        978      978           
  Partials      215      215           
```


| [Impacted Files](https://codecov.io/gh/goreleaser/goreleaser/pull/2719?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) | Coverage Δ | |
|---|---|---|
| [cmd/init.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2719/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-Y21kL2luaXQuZ28=) | `73.52% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2719?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2719?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Last update [ecb800a...29685c6](https://codecov.io/gh/goreleaser/goreleaser/pull/2719?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).


Patch:
diff --git a/.github/workflows/milestone.yml b/.github/workflows/milestone.yml
new file mode 100644
index 00000000..0a7e3ff3
--- /dev/null
+++ b/.github/workflows/milestone.yml
@@ -0,0 +1,58 @@
+# shamelessly copied from https://github.com/sigstore/cosign/blob/main/.github/workflows/milestone.yaml
+
+name: milestone
+
+on:
+  pull_request_target:
+    types: [closed]
+    branches:
+      - main
+
+jobs:
+  milestone:
+    runs-on: ubuntu-latest
+
+    permissions:
+      actions: none
+      checks: none
+      contents: read
+      deployments: none
+      issues: write
+      packages: none
+      pull-requests: write
+      repository-projects: none
+      security-events: none
+      statuses: none
+
+    steps:
+      - uses: actions/github-script@v4
+        with:
+          script: |
+            if (!context.payload.pull_request.merged) {
+              console.log('PR was not merged, skipping.');
+              return;
+            }
+
+            if (!!context.payload.pull_request.milestone) {
+              console.log('PR has existing milestone, skipping.');
+              return;
+            }
+
+            milestones = await github.issues.listMilestones({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              state: 'open',
+              sort: 'due_on',
+              direction: 'asc'
+            })
+            if (milestones.data.length === 0) {
+              console.log('There are no milestones, skipping.');
+              return;
+            }
+
+            await github.issues.update({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              issue_number: context.payload.pull_request.number,
+              milestone: milestones.data[0].number
+            });
diff --git a/cmd/init.go b/cmd/init.go
index fb98748d..24758e14 100644
--- a/cmd/init.go
+++ b/cmd/init.go
@@ -19,7 +19,7 @@ func newInitCmd() *initCmd {
 	cmd := &cobra.Command{
 		Use:           "init",
 		Aliases:       []string{"i"},
-		Short:         "Generates a .goreleaser.yml file",
+		Short:         "Generates a .goreleaser.yaml file",
 		SilenceUsage:  true,
 		SilenceErrors: true,
 		Args:          cobra.NoArgs,
@@ -49,7 +49,7 @@ func newInitCmd() *initCmd {
 		},
 	}
 
-	cmd.Flags().StringVarP(&root.config, "config", "f", ".goreleaser.yml", "Load configuration from file")
+	cmd.Flags().StringVarP(&root.config, "config", "f", ".goreleaser.yaml", "Load configuration from file")
 
 	root.cmd = cmd
 	return root
diff --git a/internal/pipe/sign/sign_docker.go b/internal/pipe/sign/sign_docker.go
index 48b8a767..f8a62868 100644
--- a/internal/pipe/sign/sign_docker.go
+++ b/internal/pipe/sign/sign_docker.go
@@ -28,7 +28,7 @@ func (DockerPipe) Default(ctx *context.Context) error {
 			cfg.Cmd = "cosign"
 		}
 		if len(cfg.Args) == 0 {
-			cfg.Args = []string{"sign", "-key=cosign.key", "$artifact"}
+			cfg.Args = []string{"sign", "--key=cosign.key", "$artifact"}
 		}
 		if cfg.Artifacts == "" {
 			cfg.Artifacts = "none"
diff --git a/pkg/config/config.go b/pkg/config/config.go
index e4527607..f8a69db5 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -194,7 +194,10 @@ type BuildHooks struct { // renamed on pro
 
 // IgnoredBuild represents a build ignored by the user.
 type IgnoredBuild struct {
-	Goos, Goarch, Goarm, Gomips string
+	Goos   string `yaml:"goos,omitempty"`
+	Goarch string `yaml:"goarch,omitempty"`
+	Goarm  string `yaml:"goarm,omitempty"`
+	Gomips string `yaml:"gomips,omitempty"`
 }
 
 // StringArray is a wrapper for an array of strings.
diff --git a/www/docs/customization/docker_sign.md b/www/docs/customization/docker_sign.md
index 1e6ce034..6e7427da 100644
--- a/www/docs/customization/docker_sign.md
+++ b/www/docs/customization/docker_sign.md
@@ -26,8 +26,8 @@ docker_signs:
 
     # Command line templateable arguments for the command
     #
-    # defaults to `["sign", "-key=cosign.key", "${artifact}"]`
-    args: ["sign", "-key=cosign.key", "-upload=false", "${artifact}"]
+    # defaults to `["sign", "--key=cosign.key", "${artifact}"]`
+    args: ["sign", "--key=cosign.key", "--upload=false", "${artifact}"]
 
 
     # Which artifacts to sign
@@ -90,5 +90,5 @@ docker_signs:
 Later on you (and anyone else) can verify the image with:
 
 ```sh
-cosign verify -key cosign.pub your/image
+cosign verify --key cosign.pub your/image
 ```
diff --git a/www/docs/customization/sign.md b/www/docs/customization/sign.md
index 5aa938f2..c15c6aba 100644
--- a/www/docs/customization/sign.md
+++ b/www/docs/customization/sign.md
@@ -119,7 +119,7 @@ Assuming you have a `cosign.key` in the repository root and a `COSIGN_PWD` envir
 signs:
 - cmd: cosign
   stdin: '{{ .Env.COSIGN_PWD }}'
-  args: ["sign-blob", "-key=cosign.key", "-output=${signature}", "${artifact}"]
+  args: ["sign-blob", "--key=cosign.key", "--output=${signature}", "${artifact}"]
   artifacts: all
 ```
 
@@ -202,7 +202,7 @@ but you'll need to manually add the `.sig` files to the release and/or archive:
 builds:
 - hooks:
     post:
-      - sh -c "echo $COSIGN_PWD | cosign sign-blob -key cosign.key {{ .Path }} > dist/{{ .ProjectName }}_{{ .Version }}_{{ .Target }}.sig"
+      - sh -c "COSIGN_PASSWORD=$COSIGN_PWD cosign sign-blob --key cosign.key --output dist/{{ .ProjectName }}_{{ .Version }}_{{ .Target }}.sig {{ .Path }}"
 
 # add to the release directly:
 release:
diff --git a/www/docs/quick-start.md b/www/docs/quick-start.md
index 5857db61..05329708 100644
--- a/www/docs/quick-start.md
+++ b/www/docs/quick-start.md
@@ -44,6 +44,9 @@ In order to release to GitHub, you'll need to export a `GITHUB_TOKEN` environmen
 It will be used to deploy releases to your GitHub repository.
 You can create a new github token [here](https://github.com/settings/tokens/new).
 
+!!! info
+    The minimum permissions the `GITHUB_TOKEN` should have to run this are `write:packages`
+
 ```sh
 export GITHUB_TOKEN="YOUR_GH_TOKEN"
 ```
diff --git a/www/docs/static/schema.json b/www/docs/static/schema.json
index a24e5ead..68123688 100644
--- a/www/docs/static/schema.json
+++ b/www/docs/static/schema.json
@@ -880,23 +880,17 @@
 				]
 			},
 			"IgnoredBuild": {
-				"required": [
-					"Goos",
-					"Goarch",
-					"Goarm",
-					"Gomips"
-				],
 				"properties": {
-					"Goos": {
+					"goos": {
 						"type": "string"
 					},
-					"Goarch": {
+					"goarch": {
 						"type": "string"
 					},
-					"Goarm": {
+					"goarm": {
 						"type": "string"
 					},
-					"Gomips": {
+					"gomips": {
 						"type": "string"
 					}
 				},


Test patch:
diff --git a/internal/pipe/sign/sign_docker_test.go b/internal/pipe/sign/sign_docker_test.go
index 9a4f4954..05747a6a 100644
--- a/internal/pipe/sign/sign_docker_test.go
+++ b/internal/pipe/sign/sign_docker_test.go
@@ -25,7 +25,7 @@ func TestDockerSignDefault(t *testing.T) {
 	require.NoError(t, err)
 	require.Equal(t, ctx.Config.DockerSigns[0].Cmd, "cosign")
 	require.Equal(t, ctx.Config.DockerSigns[0].Signature, "")
-	require.Equal(t, ctx.Config.DockerSigns[0].Args, []string{"sign", "-key=cosign.key", "$artifact"})
+	require.Equal(t, ctx.Config.DockerSigns[0].Args, []string{"sign", "--key=cosign.key", "$artifact"})
 	require.Equal(t, ctx.Config.DockerSigns[0].Artifacts, "none")
 }
 
@@ -69,7 +69,7 @@ func TestDockerSignArtifacts(t *testing.T) {
 					Artifacts: "all",
 					Stdin:     &password,
 					Cmd:       "cosign",
-					Args:      []string{"sign", "-key=" + key, "-upload=false", "${artifact}"},
+					Args:      []string{"sign", "--key=" + key, "-upload=false", "${artifact}"},
 				},
 			},
 		},