Skip to content

Commit 752e1a6

Browse files
Devops 384 action upgrade (#37)
* feat: update the action to uv and python 3.13 * feat: update the Dockerfile and entrypoint script * feat: update the Dockerfile * fix: jwt set up from pvt key
1 parent b15b511 commit 752e1a6

7 files changed

Lines changed: 316 additions & 344 deletions

File tree

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Container image that runs your code
2-
FROM python:3.11-slim-bullseye
2+
FROM python:3.13-slim-bullseye
33

44
WORKDIR /app
55
# Copies your code file from your action repository to the filesystem path `/` of the container
66
COPY . /app/
77

8-
# Install pipenv
9-
RUN chmod +x entrypoint.sh && apt-get update -y && pip install pipenv
8+
# Install uv
9+
RUN chmod +x entrypoint.sh && apt-get update -y && pip install uv
1010

1111
# Code file to execute when the docker container starts up (`entrypoint.sh`)
1212
ENTRYPOINT ["/app/entrypoint.sh"]

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Default target
2+
.DEFAULT_GOAL := help
3+
4+
# Variables
5+
UV := uv
6+
7+
.PHONY: help install sync update tree add remove uninstall clean run lock
8+
9+
help: ## Show available commands
10+
@echo "Available commands:"
11+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
12+
awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
13+
14+
install: ## Install dependencies from pyproject.toml
15+
$(UV) sync
16+
17+
sync: ## Sync environment with lock file
18+
$(UV) sync
19+
20+
update: ## Update dependencies
21+
$(UV) lock --upgrade
22+
$(UV) sync
23+
24+
tree: ## Show dependency tree
25+
$(UV) tree
26+
27+
lock: ## Generate/update uv.lock
28+
$(UV) lock
29+
30+
add: ## Add a package (usage: make add package=requests)
31+
$(UV) add $(package)
32+
33+
remove: ## Remove a package (usage: make remove package=requests)
34+
$(UV) remove $(package)
35+
36+
uninstall: ## Alias for remove
37+
$(UV) remove $(package)
38+
39+
run: ## Run python app (usage: make run script=main.py)
40+
$(UV) run python $(script)
41+
42+
clean: ## Remove virtual environment and cache
43+
rm -rf .venv
44+
rm -rf .pytest_cache
45+
rm -rf __pycache__
46+
find . -type d -name "__pycache__" -exec rm -rf {} +

Pipfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

Pipfile.lock

Lines changed: 0 additions & 323 deletions
This file was deleted.

entrypoint.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/bash
22

33
# installng pipenv and creating pipenv venv
4-
cd /app && pipenv install --skip-lock
4+
cd /app && uv sync && uv tree
55

66
# Capture arguments
77
GITHUB_APP_ID="$1"
@@ -10,7 +10,8 @@ OWNER="$3"
1010
REPOSITORIES="$4"
1111

1212
# Build the command based on available parameters
13-
CMD="pipenv run python3 /app/generate_jwt.py --github_app_id \"$GITHUB_APP_ID\" --github_app_private_key \"$GITHUB_APP_PRIVATE_KEY\""
13+
uv --version
14+
CMD="uv run python3 /app/generate_jwt.py --github_app_id \"$GITHUB_APP_ID\" --github_app_private_key \"$GITHUB_APP_PRIVATE_KEY\""
1415

1516
if [ -n "$OWNER" ]; then
1617
CMD="$CMD --owner \"$OWNER\""

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[project]
2+
name = "github-access-using-githubapp"
3+
version = "3.0.0"
4+
description = "An action to generate GitHub Installation Access Token using GitHub App's private key and AppId."
5+
requires-python = ">=3.13"
6+
authors = [
7+
{ name = "githubofkrishnadhas" }
8+
]
9+
10+
dependencies = [
11+
"requests >= 2.34.2",
12+
"jwt>= 1.4.0",
13+
"cryptography >=48.0.0",
14+
"python-dotenv >= 1.2.2"
15+
]

uv.lock

Lines changed: 249 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)