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

chore: catch up repo standards #41

Merged
merged 2 commits into from
Apr 1, 2024
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
19 changes: 0 additions & 19 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
---
###########################
###########################
## Markdown Linter rules ##
###########################
###########################

# Linter rules doc:
# - https://github.com/DavidAnson/markdownlint
#
# Note:
# To comment out a single error:
# <!-- markdownlint-disable -->
# any violations you want
# <!-- markdownlint-restore -->
#

###############
# Rules by id #
###############
# line length
MD013: false
# singe h1
Expand Down
5 changes: 3 additions & 2 deletions .github/linters/.mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Global options:

[mypy]
disable_error_code = attr-defined, import-not-found

[mypy-github3.*]
ignore_missing_imports = True
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ lint:
# stop the build if there are Python syntax errors or undefined names
flake8 . --config=.github/linters/.flake8 --count --select=E9,F63,F7,F82 --show-source
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --config=.github/linters/.flake8 --count --exit-zero --max-complexity=100 --max-line-length=150
flake8 . --config=.github/linters/.flake8 --count --exit-zero --max-complexity=15 --max-line-length=150
isort --settings-file=.github/linters/.isort.cfg .
pylint --rcfile=.github/linters/.python-lint --fail-under=9.0 *.py
mypy --config-file=.github/linters/.mypy.ini *.py
black .
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,28 @@ If you need support using this project or have questions about it, please [open

Below are the allowed configuration options:

#### Authentication

This action can be configured to authenticate with GitHub App Installation or Personal Access Token (PAT). If all configuration options are provided, the GitHub App Installation configuration has precedence. You can choose one of the following methods to authenticate:

##### GitHub App Installation

| field | required | default | description |
|-------------------------------|----------|---------|-------------|
| `GH_APP_ID` | True | `""` | GitHub Application ID. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. |
| `GH_APP_INSTALLATION_ID` | True | `""` | GitHub Application Installation ID. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. |
| `GH_APP_PRIVATE_KEY` | True | `""` | GitHub Application Private Key. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. |

##### Personal Access Token (PAT)

| field | required | default | description |
|-------------------------------|----------|---------|-------------|
| `GH_TOKEN` | True | `""` | The GitHub Token used to scan the repository. Must have read access to all repository you are interested in scanning. |

#### Other Configuration Options

| field | required | default | description |
|---------------------------|----------|---------|-------------|
| `GH_TOKEN` | True | "" | The GitHub Token used to scan the repository or organization. Must have write access to all repository you are interested in scanning so that an issue or pull request can be created. |
| `GH_APP_ID` | False | `""` | GitHub Application ID. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. |
| `GH_APP_INSTALLATION_ID` | False | `""` | GitHub Application Installation ID. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. |
| `GH_APP_PRIVATE_KEY` | False | `""` | GitHub Application Private Key. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. |
| `GH_ENTERPRISE_URL` | False | "" | The `GH_ENTERPRISE_URL` is used to connect to an enterprise server instance of GitHub. github.com users should not enter anything here. |
| `ORGANIZATION` | Required to have `ORGANIZATION` or `REPOSITORY` | | The name of the GitHub organization which you want this action to work from. ie. github.com/github would be `github` |
| `REPOSITORY` | Required to have `ORGANIZATION` or `REPOSITORY` | | The name of the repository and organization which you want this action to work from. ie. `github/cleanowners` or a comma separated list of multiple repositories `github/cleanowners,super-linter/super-linter` |
Expand All @@ -57,7 +73,7 @@ jobs:
name: cleanowners
runs-on: ubuntu-latest
permissions:
issues: write
issues: write

steps:
- name: Run cleanowners action
Expand Down Expand Up @@ -85,7 +101,7 @@ jobs:
name: cleanowners
runs-on: ubuntu-latest
permissions:
issues: write
issues: write

steps:
- name: Run cleanowners action
Expand Down Expand Up @@ -117,7 +133,7 @@ jobs:
name: cleanowners
runs-on: ubuntu-latest
permissions:
issues: write
issues: write

steps:
- name: Run cleanowners action
Expand Down
3 changes: 3 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
black==24.3.0
flake8==7.0.0
mypy==1.8.0
mypy-extensions==1.0.0
pylint==3.1.0
pytest==8.1.1
pytest-cov==5.0.0
types-requests==2.31.0.20240311
Loading