-
Notifications
You must be signed in to change notification settings - Fork 642
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b909d81
attempt: don't run unused when targeting feature branches.
DimitrisJim 76bc24a
Merge branch '04-channel-upgrades' into no-lint-unused
DimitrisJim 987d839
Match 04-channel-upgrades version.
DimitrisJim d74c44b
Merge branch '04-channel-upgrades' into no-lint-unused
DimitrisJim 964236d
gofmt this madlad.
DimitrisJim e62c7e0
Merge branch '04-channel-upgrades' into no-lint-unused
DimitrisJim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -6,10 +8,13 @@ on: | |
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
Comment on lines
+11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only run on pull requests not targeting main: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-excluding-branches