Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support out-format as args #769

Merged
merged 3 commits into from
Jun 12, 2023

Conversation

jrehwaldt
Copy link
Contributor

@jrehwaldt jrehwaldt commented Jun 12, 2023

This PR adds support for --out-format as supported arguments.

when not set, behavior is unchanged and the github-actions format is added.
When set, and github-actions is not given, it is added as the first output, otherwise, it is not added.
Any other provided format is preserved.

Fixes #458
Fixes #362
Closes #613

@ldez ldez added the enhancement New feature or request label Jun 12, 2023
@ldez ldez force-pushed the support-out-format-args-overwrite branch from 7f7f836 to 3a46c09 Compare June 12, 2023 08:22
@ldez ldez merged commit 322510a into golangci:master Jun 12, 2023
@jrehwaldt
Copy link
Contributor Author

Unfortunately, the code contains a bug. The resulting argument for

      - name: golangci-lint
        uses: golangci/golangci-lint-action@322510a3eacd2fcb0ad853cfdb7573089cf4995e
        with:
          version: 1.20
          working-directory: ./scripts/go
          args: --issues-exit-code=0 --out-format=checkstyle:golangci-lint-report.xml

is

/home/runner/golangci-lint-1.53.2-linux-amd64/golangci-lint run --out-format=checkstyle:golangci-lint-report.xml,github-actions --path-prefix=./scripts/go --issues-exit-code=0 --out-format=checkstyle:golangci-lint-report.xml

It contains the --out-format argument twice, overruling the fist parameter.

@ldez
Copy link
Member

ldez commented Jun 12, 2023

Yes I missed that

@jrehwaldt
Copy link
Contributor Author

jrehwaldt commented Jun 12, 2023

I guess a const userArgsStripped = userArgs.replaceAll(/--out-format=.+?(?=\s)/, "") might do. This is actually wrong for cases when the out-format arg is the last argument and your regex using \S much better.

@jrehwaldt
Copy link
Contributor Author

I was also wondering if the new code will concatenate "" with "github-actions" resulting in a string --out-format=,github-actions (note the comma) when no arg --out-format is given. Nevertheless, I did not try that.

@ldez
Copy link
Member

ldez commented Jun 12, 2023

I was also wondering if the new code will concatenate "" with "github-actions" resulting in a string --out-format=,github-actions (note the comma) when no arg --out-format is given. Nevertheless, I did not try that.

No, I already checked that.

another-rex referenced this pull request in google/osv-scanner Jun 21, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/checkout](https://togithub.com/actions/checkout) | action |
patch | `v3.5.2` -> `v3.5.3` |
| [docker/login-action](https://togithub.com/docker/login-action) |
action | digest | `f4ef78c` -> `465a078` |
|
[docker/setup-buildx-action](https://togithub.com/docker/setup-buildx-action)
| action | digest | `4b4e9c3` -> `ecf9528` |
|
[docker/setup-qemu-action](https://togithub.com/docker/setup-qemu-action)
| action | digest | `e81a89b` -> `2b82ce8` |
| [github/codeql-action](https://togithub.com/github/codeql-action) |
action | minor | `v2.3.6` -> `v2.20.0` |
|
[golangci/golangci-lint-action](https://togithub.com/golangci/golangci-lint-action)
| action | minor | `v3.5.0` -> `v3.6.0` |
|
[goreleaser/goreleaser-action](https://togithub.com/goreleaser/goreleaser-action)
| action | minor | `v4.2.0` -> `v4.3.0` |
|
[slsa-framework/slsa-github-generator](https://togithub.com/slsa-framework/slsa-github-generator)
| action | minor | `v1.6.0` -> `v1.7.0` |

---

### Release Notes

<details>
<summary>actions/checkout</summary>

###
[`v3.5.3`](https://togithub.com/actions/checkout/blob/HEAD/CHANGELOG.md#v353)

[Compare
Source](https://togithub.com/actions/checkout/compare/v3.5.2...v3.5.3)

- [Fix: Checkout fail in self-hosted runners when faulty submodule are
checked-in](https://togithub.com/actions/checkout/pull/1196)
- [Fix typos found by
codespell](https://togithub.com/actions/checkout/pull/1287)
- [Add support for sparse
checkouts](https://togithub.com/actions/checkout/pull/1369)

</details>

<details>
<summary>github/codeql-action</summary>

###
[`v2.20.0`](https://togithub.com/github/codeql-action/compare/v2.3.6...v2.20.0)

[Compare
Source](https://togithub.com/github/codeql-action/compare/v2.3.6...v2.20.0)

</details>

<details>
<summary>golangci/golangci-lint-action</summary>

###
[`v3.6.0`](https://togithub.com/golangci/golangci-lint-action/releases/tag/v3.6.0)

[Compare
Source](https://togithub.com/golangci/golangci-lint-action/compare/v3.5.0...v3.6.0)

#### What's Changed

- docs: fix example by [@&#8203;yuki0920](https://togithub.com/yuki0920)
in
[https://github.com/golangci/golangci-lint-action/pull/762](https://togithub.com/golangci/golangci-lint-action/pull/762)
- doc: Add custom configuration file path to args by
[@&#8203;Aisuko](https://togithub.com/Aisuko) in
[https://github.com/golangci/golangci-lint-action/pull/767](https://togithub.com/golangci/golangci-lint-action/pull/767)
- feat: add install-mode by [@&#8203;ldez](https://togithub.com/ldez) in
[https://github.com/golangci/golangci-lint-action/pull/768](https://togithub.com/golangci/golangci-lint-action/pull/768)
- feat: support out-format as args by
[@&#8203;jrehwaldt](https://togithub.com/jrehwaldt) in
[https://github.com/golangci/golangci-lint-action/pull/769](https://togithub.com/golangci/golangci-lint-action/pull/769)
- fix: out-format by [@&#8203;ldez](https://togithub.com/ldez) in
[https://github.com/golangci/golangci-lint-action/pull/770](https://togithub.com/golangci/golangci-lint-action/pull/770)

#### New Contributors

- [@&#8203;yuki0920](https://togithub.com/yuki0920) made their first
contribution in
[https://github.com/golangci/golangci-lint-action/pull/762](https://togithub.com/golangci/golangci-lint-action/pull/762)
- [@&#8203;Aisuko](https://togithub.com/Aisuko) made their first
contribution in
[https://github.com/golangci/golangci-lint-action/pull/767](https://togithub.com/golangci/golangci-lint-action/pull/767)
- [@&#8203;ldez](https://togithub.com/ldez) made their first
contribution in
[https://github.com/golangci/golangci-lint-action/pull/768](https://togithub.com/golangci/golangci-lint-action/pull/768)
- [@&#8203;jrehwaldt](https://togithub.com/jrehwaldt) made their first
contribution in
[https://github.com/golangci/golangci-lint-action/pull/769](https://togithub.com/golangci/golangci-lint-action/pull/769)

**Full Changelog**:
golangci/golangci-lint-action@v3.5.0...v3.6.0

</details>

<details>
<summary>goreleaser/goreleaser-action</summary>

###
[`v4.3.0`](https://togithub.com/goreleaser/goreleaser-action/releases/tag/v4.3.0)

[Compare
Source](https://togithub.com/goreleaser/goreleaser-action/compare/v4.2.0...v4.3.0)

#### What's Changed

- Update in command examples by
[@&#8203;arnaduga](https://togithub.com/arnaduga) in
[https://github.com/goreleaser/goreleaser-action/pull/393](https://togithub.com/goreleaser/goreleaser-action/pull/393)
- chore(deps): bump yargs from 17.6.2 to 17.7.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/goreleaser/goreleaser-action/pull/395](https://togithub.com/goreleaser/goreleaser-action/pull/395)
- Improve documentation for use of `GITHUB_TOKEN` by
[@&#8203;jamietanna](https://togithub.com/jamietanna) in
[https://github.com/goreleaser/goreleaser-action/pull/399](https://togithub.com/goreleaser/goreleaser-action/pull/399)
- chore(deps): bump actions/setup-go from 3 to 4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/goreleaser/goreleaser-action/pull/403](https://togithub.com/goreleaser/goreleaser-action/pull/403)
- chore(deps): bump docker/bake-action from 2 to 3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/goreleaser/goreleaser-action/pull/408](https://togithub.com/goreleaser/goreleaser-action/pull/408)
- chore(deps): bump semver from 7.3.8 to 7.5.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/goreleaser/goreleaser-action/pull/407](https://togithub.com/goreleaser/goreleaser-action/pull/407)
- Bump setup-go action version to v4 in README by
[@&#8203;kishaningithub](https://togithub.com/kishaningithub) in
[https://github.com/goreleaser/goreleaser-action/pull/411](https://togithub.com/goreleaser/goreleaser-action/pull/411)
- ci: split test and validate workflow by
[@&#8203;crazy-max](https://togithub.com/crazy-max) in
[https://github.com/goreleaser/goreleaser-action/pull/413](https://togithub.com/goreleaser/goreleaser-action/pull/413)
- chore: update yarn to 3.5.1 by
[@&#8203;crazy-max](https://togithub.com/crazy-max) in
[https://github.com/goreleaser/goreleaser-action/pull/412](https://togithub.com/goreleaser/goreleaser-action/pull/412)
- chore(deps): bump yargs from 17.7.1 to 17.7.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/goreleaser/goreleaser-action/pull/410](https://togithub.com/goreleaser/goreleaser-action/pull/410)
- feat: support nightly by
[@&#8203;caarlos0](https://togithub.com/caarlos0) in
[https://github.com/goreleaser/goreleaser-action/pull/419](https://togithub.com/goreleaser/goreleaser-action/pull/419)

#### New Contributors

- [@&#8203;arnaduga](https://togithub.com/arnaduga) made their first
contribution in
[https://github.com/goreleaser/goreleaser-action/pull/393](https://togithub.com/goreleaser/goreleaser-action/pull/393)
- [@&#8203;jamietanna](https://togithub.com/jamietanna) made their first
contribution in
[https://github.com/goreleaser/goreleaser-action/pull/399](https://togithub.com/goreleaser/goreleaser-action/pull/399)
- [@&#8203;kishaningithub](https://togithub.com/kishaningithub) made
their first contribution in
[https://github.com/goreleaser/goreleaser-action/pull/411](https://togithub.com/goreleaser/goreleaser-action/pull/411)

**Full Changelog**:
goreleaser/goreleaser-action@v4.2.0...v4.3.0

</details>

<details>
<summary>slsa-framework/slsa-github-generator</summary>

###
[`v1.7.0`](https://togithub.com/slsa-framework/slsa-github-generator/releases/tag/v1.7.0)

[Compare
Source](https://togithub.com/slsa-framework/slsa-github-generator/compare/v1.6.0...v1.7.0)

See the [CHANGELOG](./CHANGELOG.md) for details.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 6am on monday" in timezone
Australia/Sydney, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/google/osv-scanner).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
kodiakhq bot referenced this pull request in cloudquery/cloudquery Aug 1, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| booxmedialtd/ws-action-parse-semver | action | digest | `966a265` -> `7784200` |
| [docker.elastic.co/elasticsearch/elasticsearch](https://togithub.com/elastic/elasticsearch) | service | minor | `8.7.0` -> `8.9.0` |
| getmeili/meilisearch | service | minor | `v1.1.0` -> `v1.3.0` |
| [golangci/golangci-lint-action](https://togithub.com/golangci/golangci-lint-action) | action | minor | `v3.4.0` -> `v3.6.0` |
| mtlynch/firestore-emulator | service | digest | `327f3c8` -> `74dc4be` |
| peter-evans/create-or-update-comment | action | digest | `5f728c3` -> `716151b` |
| peter-evans/find-comment | action | digest | `ebedc73` -> `5cea877` |
| tinkerpop/gremlin-server | service | patch | `3.6.2` -> `3.6.4` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>elastic/elasticsearch (docker.elastic.co/elasticsearch/elasticsearch)</summary>

### [`v8.9.0`](https://togithub.com/elastic/elasticsearch/releases/tag/v8.9.0): Elasticsearch 8.9.0

[Compare Source](https://togithub.com/elastic/elasticsearch/compare/v8.8.2...v8.9.0)

Downloads: https://elastic.co/downloads/elasticsearch
Release notes: https://www.elastic.co/guide/en/elasticsearch/reference/8.9/release-notes-8.9.0.html

### [`v8.8.2`](https://togithub.com/elastic/elasticsearch/releases/tag/v8.8.2): Elasticsearch 8.8.2

[Compare Source](https://togithub.com/elastic/elasticsearch/compare/v8.8.1...v8.8.2)

Downloads: https://elastic.co/downloads/elasticsearch
Release notes: https://www.elastic.co/guide/en/elasticsearch/reference/8.8/release-notes-8.8.2.html

### [`v8.8.1`](https://togithub.com/elastic/elasticsearch/releases/tag/v8.8.1): Elasticsearch 8.8.1

[Compare Source](https://togithub.com/elastic/elasticsearch/compare/v8.8.0...v8.8.1)

Downloads: https://elastic.co/downloads/elasticsearch
Release notes: https://www.elastic.co/guide/en/elasticsearch/reference/8.8/release-notes-8.8.1.html

### [`v8.8.0`](https://togithub.com/elastic/elasticsearch/releases/tag/v8.8.0): Elasticsearch 8.8.0

[Compare Source](https://togithub.com/elastic/elasticsearch/compare/v8.7.1...v8.8.0)

Downloads: https://elastic.co/downloads/elasticsearch
Release notes: https://www.elastic.co/guide/en/elasticsearch/reference/8.8/release-notes-8.8.0.html

### [`v8.7.1`](https://togithub.com/elastic/elasticsearch/releases/tag/v8.7.1): Elasticsearch 8.7.1

[Compare Source](https://togithub.com/elastic/elasticsearch/compare/v8.7.0...v8.7.1)

Downloads: https://elastic.co/downloads/elasticsearch
Release notes: https://www.elastic.co/guide/en/elasticsearch/reference/8.7/release-notes-8.7.1.html

</details>

<details>
<summary>golangci/golangci-lint-action (golangci/golangci-lint-action)</summary>

### [`v3.6.0`](https://togithub.com/golangci/golangci-lint-action/releases/tag/v3.6.0)

[Compare Source](https://togithub.com/golangci/golangci-lint-action/compare/v3.5.0...v3.6.0)

#### What's Changed

-   docs: fix example by [@&#8203;yuki0920](https://togithub.com/yuki0920) in [https://github.com/golangci/golangci-lint-action/pull/762](https://togithub.com/golangci/golangci-lint-action/pull/762)
-   doc: Add custom configuration file path to args by [@&#8203;Aisuko](https://togithub.com/Aisuko) in [https://github.com/golangci/golangci-lint-action/pull/767](https://togithub.com/golangci/golangci-lint-action/pull/767)
-   feat: add install-mode by [@&#8203;ldez](https://togithub.com/ldez) in [https://github.com/golangci/golangci-lint-action/pull/768](https://togithub.com/golangci/golangci-lint-action/pull/768)
-   feat: support out-format as args by [@&#8203;jrehwaldt](https://togithub.com/jrehwaldt) in [https://github.com/golangci/golangci-lint-action/pull/769](https://togithub.com/golangci/golangci-lint-action/pull/769)
-   fix: out-format by [@&#8203;ldez](https://togithub.com/ldez) in [https://github.com/golangci/golangci-lint-action/pull/770](https://togithub.com/golangci/golangci-lint-action/pull/770)

#### New Contributors

-   [@&#8203;yuki0920](https://togithub.com/yuki0920) made their first contribution in [https://github.com/golangci/golangci-lint-action/pull/762](https://togithub.com/golangci/golangci-lint-action/pull/762)
-   [@&#8203;Aisuko](https://togithub.com/Aisuko) made their first contribution in [https://github.com/golangci/golangci-lint-action/pull/767](https://togithub.com/golangci/golangci-lint-action/pull/767)
-   [@&#8203;ldez](https://togithub.com/ldez) made their first contribution in [https://github.com/golangci/golangci-lint-action/pull/768](https://togithub.com/golangci/golangci-lint-action/pull/768)
-   [@&#8203;jrehwaldt](https://togithub.com/jrehwaldt) made their first contribution in [https://github.com/golangci/golangci-lint-action/pull/769](https://togithub.com/golangci/golangci-lint-action/pull/769)

**Full Changelog**: golangci/golangci-lint-action@v3.5.0...v3.6.0

### [`v3.5.0`](https://togithub.com/golangci/golangci-lint-action/releases/tag/v3.5.0)

[Compare Source](https://togithub.com/golangci/golangci-lint-action/compare/v3.4.0...v3.5.0)

#### What's Changed

-   doc: add quote around go version by [@&#8203;vaughany](https://togithub.com/vaughany) in [https://github.com/golangci/golangci-lint-action/pull/670](https://togithub.com/golangci/golangci-lint-action/pull/670)
-   docs/build: update to setup-go@v4 by [@&#8203;caarlos0](https://togithub.com/caarlos0) in [https://github.com/golangci/golangci-lint-action/pull/704](https://togithub.com/golangci/golangci-lint-action/pull/704)
-   fix invalid docs about cache key by [@&#8203;hori-ryota](https://togithub.com/hori-ryota) in [https://github.com/golangci/golangci-lint-action/pull/695](https://togithub.com/golangci/golangci-lint-action/pull/695)

#### New Contributors

-   [@&#8203;vaughany](https://togithub.com/vaughany) made their first contribution in [https://github.com/golangci/golangci-lint-action/pull/670](https://togithub.com/golangci/golangci-lint-action/pull/670)
-   [@&#8203;caarlos0](https://togithub.com/caarlos0) made their first contribution in [https://github.com/golangci/golangci-lint-action/pull/704](https://togithub.com/golangci/golangci-lint-action/pull/704)
-   [@&#8203;hori-ryota](https://togithub.com/hori-ryota) made their first contribution in [https://github.com/golangci/golangci-lint-action/pull/695](https://togithub.com/golangci/golangci-lint-action/pull/695)

**Full Changelog**: golangci/golangci-lint-action@v3.4.0...v3.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzYuMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
@renovate renovate bot mentioned this pull request Aug 15, 2023
1 task
@ldez ldez mentioned this pull request Feb 16, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure output for sonar GitHub Annotations suppresses normal output
2 participants