Skip to content

Commit

Permalink
Run Gnitpick using container action
Browse files Browse the repository at this point in the history
  • Loading branch information
ypcs committed Jan 22, 2025
1 parent deb2810 commit f9880a1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/gnitpick.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
name: "Nitpick git commits"

on: [push, pull_request]

env:
PYTHON_VERSION: 3.6
on: [push]

jobs:
nitpick:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Setup repository
uses: actions/checkout@v2

- name: Set up python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
uses: actions/checkout@v4

- name: Run gnitpick
run: python3 gnitpick.py --verbose
uses: Seravo/gnitpick@feature/container
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ghcr.io/seravo/ubuntu:noble

ARG APT_PROXY

RUN sed -i 's/main$/main universe/g' /etc/apt/sources.list && \
apt-setup && \
apt-get --assume-yes install \
python3 && \
apt-cleanup

RUN useradd user && \
mkdir -p /workdir
WORKDIR /workdir

COPY gnitpick.py /usr/local/bin/

USER user

ENTRYPOINT ["/usr/bin/python3", "/usr/local/bin/gnitpick.py"]
CMD ["--verbose"]
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: 'Lint git commits'
description: 'Run linting for git commits with Gnitpick'

runs:
using: 'docker'
image: 'Dockerfile'
args:
- '--verbose'

0 comments on commit f9880a1

Please sign in to comment.