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

annotations display on 2 PR (develop and staging, although I don't run golangci-lint in staging) #806

Closed
3 tasks done
fpt-phongnx8 opened this issue Jul 26, 2023 · 1 comment
Labels
question Further information is requested

Comments

@fpt-phongnx8
Copy link

fpt-phongnx8 commented Jul 26, 2023

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Description of the problem

Issue

  • annotations display on 2 PR (develop and staging, although I don't run golangci-lint in staging)

I create github feature branch: feature/feature-a

I create 2 PR

  • from feature/feature-a to develop
  • from feature/feature-a to staging

See code below, you can see golangci-lint-action run only create PR to develop branch.
And when I create PR to staging branch, I will run another check, not golangci-lint-action

But I realize that annotations display at File changes on both 2 PR.

I don't know if this is the author's purpose.
I think It's bug.

Version of golangci-lint

version: v1.53

Version of the GitHub Action

golangci/golangci-lint-action@v3

Workflow file

pull_request.yml

on:
    pull_request:
      branches: 
        - 'develop'
        - 'staging'

jobs:
  lint-check:
    name: golangci-lint
    if: github.event.pull_request.base.ref == 'develop'
    uses: ./.github/workflows/golangci-lint.yml

  container-security-check:
    name: container-security-check
    if: github.event.pull_request.base.ref == 'staging'
    uses: ./.github/workflows/container-security-check.yml

golangci-lint.yml

# golangci-lint.yml (called workflow)
name: golangci-lint
on:
  workflow_call:
    inputs:
      working-directory:
        description: working directory
        type: string
        required: false
        default: "./"

jobs:
  lint:
    name: golangci-lint
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
        working-directory: ${{ inputs.working-directory }}
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
          go-version-file: ${{ inputs.working-directory }}go.mod
          cache: false

      - name: golangci-lint
        uses: golangci/golangci-lint-action@v3
        continue-on-error: true
        with:
          version: v1.53
          working-directory: ${{ inputs.working-directory }}
          args: --timeout=10m --config=${{ inputs.working-directory }}.golangci.yml

Go version

1.20

Code example or link to a public repository

@ldez ldez added the question Further information is requested label May 1, 2024
@ldez
Copy link
Member

ldez commented May 9, 2024

Hello,

The behavior of the annotations is not controlled by this action.

It's a GitHub behavior, we cannot change it.

@ldez ldez closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants