Skip to content
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
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Container image that runs your code
FROM python:3.11-slim-bullseye
FROM python:3.13-slim-bullseye

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

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

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/app/entrypoint.sh"]
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Default target
.DEFAULT_GOAL := help

# Variables
UV := uv

.PHONY: help install sync update tree add remove uninstall clean run lock

help: ## Show available commands
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'

install: ## Install dependencies from pyproject.toml
$(UV) sync

sync: ## Sync environment with lock file
$(UV) sync

update: ## Update dependencies
$(UV) lock --upgrade
$(UV) sync

tree: ## Show dependency tree
$(UV) tree

lock: ## Generate/update uv.lock
$(UV) lock

add: ## Add a package (usage: make add package=requests)
$(UV) add $(package)

remove: ## Remove a package (usage: make remove package=requests)
$(UV) remove $(package)

uninstall: ## Alias for remove
$(UV) remove $(package)

run: ## Run python app (usage: make run script=main.py)
$(UV) run python $(script)

clean: ## Remove virtual environment and cache
rm -rf .venv
rm -rf .pytest_cache
rm -rf __pycache__
find . -type d -name "__pycache__" -exec rm -rf {} +
16 changes: 0 additions & 16 deletions Pipfile

This file was deleted.

323 changes: 0 additions & 323 deletions Pipfile.lock

This file was deleted.

5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/bash

# installng pipenv and creating pipenv venv
cd /app && pipenv install --skip-lock
cd /app && uv sync && uv tree
Comment thread
githubofkrishnadhas marked this conversation as resolved.

# Capture arguments
GITHUB_APP_ID="$1"
Expand All @@ -10,7 +10,8 @@ OWNER="$3"
REPOSITORIES="$4"

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

if [ -n "$OWNER" ]; then
CMD="$CMD --owner \"$OWNER\""
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[project]
name = "github-access-using-githubapp"
version = "3.0.0"
description = "An action to generate GitHub Installation Access Token using GitHub App's private key and AppId."
requires-python = ">=3.13"
authors = [
{ name = "githubofkrishnadhas" }
]

dependencies = [
"requests >= 2.34.2",
"jwt>= 1.4.0",
"cryptography >=48.0.0",
"python-dotenv >= 1.2.2"
]
249 changes: 249 additions & 0 deletions uv.lock

Large diffs are not rendered by default.