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
120 changes: 0 additions & 120 deletions .dockerignore

This file was deleted.

29 changes: 29 additions & 0 deletions .github/actions/people/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM python:3.11-slim

# Create a non-root user
RUN useradd -m appuser && \
mkdir -p /app && \
chown -R appuser:appuser /app

WORKDIR /app

# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
rm -rf /var/lib/apt/lists/*

# Copy requirements first for better layer caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY --chown=appuser:appuser ./app /app/app

# Switch to non-root user
USER appuser

# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD python -c "import sys; import urllib.request; urllib.request.urlopen('http://localhost:8080/health')" || exit 1

CMD ["python", "-m", "app.main"]
85 changes: 85 additions & 0 deletions .github/actions/people/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Axilo People Action

This GitHub Action generates data for the Axilo People page by analyzing repository activity, including issues, pull requests, and discussions.

## Features

- Tracks contributions from repository members
- Identifies experts based on issue and discussion participation
- Generates statistics about community engagement
- Supports both scheduled and manual execution
- Includes dry-run mode for testing

## Inputs

| Name | Required | Description | Default |
| --------- | -------- | ----------------------------------------- | ------- |
| `token` | Yes | GitHub token with appropriate permissions | - |
| `dry_run` | No | Run in dry-run mode (no changes made) | `false` |

## Secrets

- `AXILO_PEOPLE`: GitHub token with `repo` scope
- `CODECOV_TOKEN`: (Optional) Token for code coverage reporting
- `SLACK_WEBHOOK`: (Optional) Webhook URL for failure notifications

## Usage

### Basic Usage

```yaml
- uses: ./.github/actions/people
with:
token: ${{ secrets.AXILO_PEOPLE }}
```

### Manual Trigger with Debugging

```yaml
on:
workflow_dispatch:
inputs:
debug_enabled:
description: "Enable tmate debugging"
required: false
default: "false"
dry_run:
description: "Run in dry-run mode"
required: false
default: "false"
```

## Development

### Prerequisites

- Python 3.11+
- Docker
- pip

### Setup

1. Clone the repository
2. Install dependencies:
```bash
pip install -r requirements.txt
```

### Testing

Run the test suite:

```bash
pytest tests/ -v --cov=app --cov-report=term-missing
```

### Linting

```bash
flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 app/ --count --max-complexity=10 --max-line-length=127 --statistics
```

## License

This project is licensed under the terms of the MIT license.
10 changes: 10 additions & 0 deletions .github/actions/people/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Generate Axilo People"
description: "Generate the data for the Axilo People page"
author: "KhulnaSoft DevOps <[email protected]>"
inputs:
token:
description: "User token, to read the GitHub API. Can be passed in using {{ secrets.AXILO_PEOPLE }}"
required: true
runs:
using: "docker"
image: "Dockerfile"
Loading
Loading