Skip to content
Closed
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
32 changes: 32 additions & 0 deletions github/golangci-lint-action/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"env": {
"node": true,
"jest": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended"
],
"plugins": [
"@typescript-eslint",
"simple-import-sort"
],
"rules": {
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"sort-imports": "off"
}
}
1 change: 1 addition & 0 deletions github/golangci-lint-action/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** linguist-generated=true
88 changes: 88 additions & 0 deletions github/golangci-lint-action/.github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: 🐞 Bug Report
description: "Create a report to help us improve."
body:
- type: checkboxes
id: terms
attributes:
label: Welcome
options:
- label: Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
required: true
- label: Yes, I've searched similar issues on GitHub and didn't find any.
required: true
- label: Yes, I've included all information below (version, config, etc).
required: true

- type: textarea
id: problem
attributes:
label: Description of the problem
placeholder: Your problem description
validations:
required: true

- type: input
id: golangci-lint-version
attributes:
label: Version of golangci-lint
validations:
required: true

- type: input
id: github-action-version
attributes:
label: Version of the GitHub Action
validations:
required: true

- type: textarea
id: workflow-file
attributes:
label: Workflow file
value: |-
<details>

```yml
<add your file content here>
```

</details>
validations:
required: true

- type: textarea
id: config
attributes:
label: Golangci-lint configuration
value: |-
<details>

```yml
<add your file content here>
```

</details>
validations:
required: true

- type: input
id: go-env
attributes:
label: Go version
validations:
required: true

- type: textarea
id: code-example
attributes:
label: Code example or link to a public repository
value: |-
<details>

```go
// add your code here
```

</details>
validations:
required: true
14 changes: 14 additions & 0 deletions github/golangci-lint-action/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: 📖 Golangci-lint documentation
url: https://golangci-lint.run
about: Please take a look to our documentation.
- name: ❓ Questions
url: https://github.com/golangci/golangci-lint-action/discussions
about: If you have a question, or are looking for advice, please post on our Discussions forum!
- name: 💬 Chat on Slack
url: https://gophers.slack.com/archives/CS0TBRKPC
about: Maybe chatting with the community can help
- name: 🏡 Golangci-lint main repository
url: https://github.com/golangci/golangci-lint
about: The main repository of golangci-lint.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 💡 Feature request
description: "Suggest an idea for this project."
body:
- type: checkboxes
id: terms
attributes:
label: Welcome
options:
- label: Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
required: true
- label: Yes, I've searched similar issues on GitHub and didn't find any.
required: true

- type: textarea
id: problem
attributes:
label: Your feature request related to a problem? Please describe.
placeholder: "A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]"
validations:
required: true

- type: textarea
id: solution
attributes:
label: Describe the solution you'd like.
placeholder: "A clear and concise description of what you want to happen."
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered.
placeholder: "A clear and concise description of any alternative solutions or features you've considered."
validations:
required: true

- type: textarea
id: additional
attributes:
label: Additional context.
placeholder: "Add any other context or screenshots about the feature request here."
validations:
required: false
15 changes: 15 additions & 0 deletions github/golangci-lint-action/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
- package-ecosystem: npm
directory: "/"
groups:
dev-dependencies:
dependency-type: development
dependencies:
dependency-type: production
schedule:
interval: weekly
15 changes: 15 additions & 0 deletions github/golangci-lint-action/.github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
changelog:
categories:
- title: Changes
labels:
- '*'
exclude:
labels:
- documentation
- dependencies
- title: Documentation
labels:
- documentation
- title: Dependencies
labels:
- dependencies
46 changes: 46 additions & 0 deletions github/golangci-lint-action/.github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Code Scanning - Action"

on:
push:
branches:
- main
pull_request:
# The branches below must be a subset of the branches above
branches:
- main
schedule:
- cron: '0 17 * * 5'

jobs:
codeQL:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head of the pull request.
# Only include this option if you are running this workflow on pull requests.
fetch-depth: 2

# If this run was triggered by a pull request event then checkout
# the head of the pull request instead of the merge commit.
# Only include this step if you are running this workflow on pull requests.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
# Override language selection by uncommenting this and choosing your languages
with:
language: 'javascript'

- run: |
npm install
npm run all

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
127 changes: 127 additions & 0 deletions github/golangci-lint-action/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: "build-and-test"
on: # rebuild any PRs and main branch changes
pull_request:
branches:
- main
push:
branches:
- main

jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- if: ${{ !(github.event_name == 'pull_request' && (github.event.pull_request.user.id == 49699333 || contains(github.event.pull_request.labels.*.name, 'dependencies'))) }}
uses: actions/checkout@v4
- if: github.event_name == 'pull_request' && (github.event.pull_request.user.id == 49699333 || contains(github.event.pull_request.labels.*.name, 'dependencies'))
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

- run: |
npm install
npm run all

# Update dist files if there is label dependencies or pull request' author is dependabot[bot] (id = 49699333)
- name: Update dist files
if: github.event_name == 'pull_request' && (github.event.pull_request.user.id == 49699333 || contains(github.event.pull_request.labels.*.name, 'dependencies'))
run: |
if [[ -z $(git status -s) ]]
then
echo "No change is required"
else
echo "Updating dist directory"
git config --local user.name "dependabot[bot]"
git config --local user.email "49699333+dependabot[bot]@users.noreply.github.com"
git add --update
git commit --message="Update dist files"
git push
fi

# Fail the build if there is dirty change
- run: git diff --exit-code

test: # make sure the action works on a clean machine without building
needs: [ build ]
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-22.04-arm
- macos-latest
- windows-latest
version:
- ""
- "latest"
- "v2.1"
- "v2.1.0"
runs-on: ${{ matrix.os }}
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: oldstable
- uses: ./
with:
version: ${{ matrix.version }}
args: --timeout=5m --issues-exit-code=0 ./sample/...
only-new-issues: true

test-go-install: # make sure the action works on a clean machine without building (go-install mode)
needs: [ build ]
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-22.04-arm
- macos-latest
- windows-latest
version:
- ""
- "latest"
- "v2.1.0"
- "f6c2e6c999dfae444d1fe7f1b0d49becdae44547"
runs-on: ${{ matrix.os }}
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: oldstable
- uses: ./
with:
version: ${{ matrix.version }}
args: --timeout=5m --issues-exit-code=0 ./sample/...
only-new-issues: true
install-mode: goinstall

test-go-mod:
needs: [ build ]
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-22.04-arm
- macos-latest
- windows-latest
wd:
- sample-go-mod
- sample-go-tool
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: oldstable
- uses: ./
with:
working-directory: ${{ matrix.wd }}
args: --timeout=5m --issues-exit-code=0 ./...
Loading