Skip to content

Commit

Permalink
Merge pull request #17 from saadmk11/refactor
Browse files Browse the repository at this point in the history
Refactor Code and Use `github-action-utils` for logging
  • Loading branch information
saadmk11 committed Oct 14, 2022
2 parents e5efd10 + 5bccfb9 commit 1cd81c0
Show file tree
Hide file tree
Showing 10 changed files with 530 additions and 347 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.github/
.gitignore
README.md
CHANGELOG.md
55 changes: 55 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
default_language_version:
python: python3.10

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: check-merge-conflict

- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade
args: [--py310-plus]

- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies:
- black==22.6.0

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args:
- "--max-line-length=88"
- "--min-python-version=3.10"
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-tidy-imports
- flake8-typing-imports

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
hooks:
- id: mypy
files: ^src/
additional_dependencies: [types-requests, types-PyYAML]
22 changes: 16 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8
FROM python:3.10-slim-buster

LABEL "com.github.actions.name"="GitHub Actions Version Updater"
LABEL "com.github.actions.description"="GitHub Actions Version Updater updates GitHub Action versions in a repository and creates a pull request with the changes."
Expand All @@ -9,11 +9,21 @@ LABEL "repository"="https://github.com/saadmk11/github-actions-version-updater"
LABEL "homepage"="https://github.com/saadmk11/github-actions-version-updater"
LABEL "maintainer"="saadmk11"

COPY requirements.txt /requirements.txt
RUN apt-get update \
&& apt-get install \
-y \
--no-install-recommends \
--no-install-suggests \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN pip install -r requirements.txt
COPY ./requirements.txt .

COPY main.py /main.py
RUN pip install --no-cache-dir -r requirements.txt

RUN ["chmod", "+x", "/main.py"]
ENTRYPOINT ["python", "/main.py"]
COPY . ./app

ENV PYTHONPATH "${PYTHONPATH}:/app"

CMD ["python", "-m", "src.main"]
Loading

0 comments on commit 1cd81c0

Please sign in to comment.