Skip to content
This repository was archived by the owner on Jul 31, 2024. It is now read-only.

Commit dc2bacd

Browse files
Ismohsnyk-bot
andauthored
[Snyk] Security upgrade python from 3.12.0rc2-slim-bullseye to 3.13.0a2-slim-bullseye (#105)
* fix: Dockerfile to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-DEBIAN11-GLIBC-5927133 - https://snyk.io/vuln/SNYK-DEBIAN11-GLIBC-5927133 - https://snyk.io/vuln/SNYK-DEBIAN11-NCURSES-5421197 - https://snyk.io/vuln/SNYK-DEBIAN11-NCURSES-5421197 - https://snyk.io/vuln/SNYK-DEBIAN11-NCURSES-5421197 * Update Dockerfile with dependency installations * Update Dockerfile to upgrade pip and install dependencies and removed gcc install * Update Dockerfile to install additional dependencies * Fix Dockerfile dependencies installation * Refactor Dockerfile installation commands * Fix Dockerfile dependencies installation * Update requirements.txt * Fix Dockerfile dependencies installation order * Update Python version in Dockerfile * Update Dockerfile and fixed compile issues locally. --------- Co-authored-by: snyk-bot <[email protected]> Co-authored-by: Ismoh <[email protected]>
1 parent b450fff commit dc2bacd

File tree

4 files changed

+46
-34
lines changed

4 files changed

+46
-34
lines changed

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"cSpell.words": [
3+
"esolve",
4+
"venv",
5+
"virtualenv"
6+
]
7+
}

Dockerfile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# action will be executed in a python3 container
2-
FROM python:3.12.0rc2-slim-bullseye
3-
# copy requirements.txt to the container
4-
COPY requirements.txt /requirements.txt
5-
# install dependencies
6-
RUN pip install -r /requirements.txt
7-
# copy main.py to the container
8-
COPY main.py /main.py
9-
# run main.py
10-
CMD [ "python", "/main.py"]
1+
FROM python:3.13.0a2-slim-bullseye
2+
3+
ENV VIRTUAL_ENV=/opt/venv
4+
RUN python3 -m venv $VIRTUAL_ENV
5+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
6+
7+
COPY requirements.txt .
8+
RUN pip3 install --only-binary=:all: -r requirements.txt
9+
10+
COPY main.py .
11+
12+
CMD [ "python3", "/main.py"]

README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
[![test `pull_request`](https://img.shields.io/github/actions/workflow/status/ismoh-games/find-linked-issues/test.yml?event=pull_request&label=test%20%60pull_request%60&style=for-the-badge)](https://github.com/Ismoh-Games/find-linked-issues/actions/workflows/test.yml)
44
[![test `pull_request_target`](https://img.shields.io/github/actions/workflow/status/ismoh-games/find-linked-issues/test.yml?event=pull_request_target&label=test%20%60pull_request_target%60&style=for-the-badge)](https://github.com/Ismoh-Games/find-linked-issues/actions/workflows/test.yml)
55

6-
Marketplace action for finding the linked issues of a pull request.
6+
Marketplace action for finding the linked issues of a pull request.
77

88
## Usage
99

1010
Make use of GitHub's [keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) to link issues to a pull request by default.\
1111
You can also do this [manually](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-or-branch-to-an-issue-using-the-issue-sidebar) in the 'development' section of the pull request sidebar on the right.
1212

13-
1413
### Inputs and outputs
1514

1615
| Name INPUTS | Description | | Default |
@@ -23,7 +22,7 @@ You can also do this [manually](https://docs.github.com/en/issues/tracking-your-
2322
| `include-closed-issues` | Includes closed issues, when searching for linked issues. | optional | `false` |
2423
| **Name OUTPUTS** | **Description** | **Values** | **Defaults** |
2524
| `is-pull-request-linked-to-issues` | Whether the pull request is linked to issues or not. | `'True'` or `'False'` | `'False'` |
26-
| `linked-issues` | List of issues that are linked to the pull request. | `[1, 2, 4, 82, 124]` | `[]` |
25+
| `linked-issues` | List of issues that are linked to the pull request. | `[1, 2, 4, 82, 124]` | `[]` |
2726
| `pull-request-labels` | List of labels assigned to this pull request. | `[bug, enhancement, ..]` | `[]` |
2827

2928
Example workflow:
@@ -61,19 +60,34 @@ Example workflow:
6160
## Important notes
6261
6362
This action will only work on pull request events:
63+
6464
- [pull_request](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request)
65-
- opened
66-
- edited
67-
- synchronize
65+
- opened
66+
- edited
67+
- synchronize
6868
- [pull_request_target](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)
69-
- opened
70-
- edited
71-
- synchronize
69+
- opened
70+
- edited
71+
- synchronize
7272
7373
When using `pull_request_target` the `token` input needs to be a personal access token (PAT), because of GitHubs security settings.\
7474
If you need help with creating a PAT, check out [this](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) guide.
7575

7676
#### Further reading
77+
7778
There is a pattern used to find the linked issues in the pull request body.\
7879
To get insights on how this pattern works, check out the [regex101.com](https://regex101.com/r/f60fNx/4)!\
7980
When having problems with the pattern, you can test it out on [pythex.org](https://pythex.org).
81+
82+
## Local development
83+
84+
Windows:
85+
86+
```bash
87+
pip install virtualenv
88+
virtualenv --python %PYTHON_PATH%\\python.exe venv
89+
.\venv\Scripts\activate
90+
# python.exe -m pip install --upgrade pip
91+
pip install --only-binary=:all: -r requirements.txt
92+
#deactivate
93+
```

requirements.txt

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
certifi==2023.11.17
2-
cffi==1.16.0
3-
charset-normalizer==3.3.2
4-
Deprecated==1.2.14
5-
fastcore==1.5.29
6-
ghapi==1.0.4
7-
idna==3.6
8-
packaging==23.2
9-
pycparser==2.21
10-
PyGithub==2.1.1
11-
PyJWT==2.8.0
12-
PyNaCl==1.5.0
13-
requests==2.31.0
14-
urllib3==2.1.0
15-
wrapt==1.16.0
1+
# Automatically generated by https://github.com/damnever/pigar.
2+
3+
requests
4+
PyGithub

0 commit comments

Comments
 (0)