Skip to content

Commit

Permalink
don't run unused when targeting feature branches. (#3819)
Browse files Browse the repository at this point in the history
don't run unused when targeting feature branches.
  • Loading branch information
DimitrisJim authored Jun 14, 2023
1 parent 5e4af4c commit 3092171
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
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
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
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

0 comments on commit 3092171

Please sign in to comment.