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

attempt: don't run unused when targeting feature branches. #3819

Merged
merged 6 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/golangci-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# golangci-feature runs on pull requests from branches that do not target main.
#
# Working on feature branches (PRs where the PR base-ref != main) is a common
# workflow used, in order to make the merging of PRs easier certain lints are excluded
# when it makes sense. Currently, unused lints are excluded since many PRs will add
# unused code that will be used in a later PR.
name: golangci-lint feature branch
on:
pull_request:
# Ignore if the target is main. (Negation of golanci-lint.yml)
branches-ignore:
- main
Comment on lines +11 to +12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.4.0
with:
version: v1.52.0
args: --timeout 5m --exclude unused
5 changes: 5 additions & 0 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# golang-ci runs on pushes to main and to tags whose name starts with "v" and to pull
# requests from branches that target main.
name: golangci-lint
on:
push:
Expand All @@ -6,10 +8,13 @@ on:
branches:
- main
pull_request:
branches:
- main
Comment on lines +11 to +12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only run on PRs targeting main (one is a negation of the other).

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
Expand Down