Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Alla committed Sep 24, 2020
0 parents commit 0c2e973
Show file tree
Hide file tree
Showing 17 changed files with 546 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
15 changes: 15 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Example

on:
schedule:
- cron: "0 0 * 10 *"
workflow_dispatch:

jobs:
example:
runs-on: ubuntu-latest

steps:
- uses: browniebroke/hacktoberfest-labeler-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Run pre-commit autoupdate every day at midnight
# and create a pull request if any changes


name: Pre-commit auto-update

on:
schedule:
- cron: "0 0 * * *"

jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.2
- name: Set up Python
uses: actions/setup-python@v2.1.2
with:
python-version: 3.8
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit autoupdate
run: pre-commit autoupdate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.CPR_GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate
title: Update pre-commit hooks
commit-message: 'chore: update pre-commit hooks'
body: Update versions of tools in pre-commit configs to latest version.
labels: dependencies
25 changes: 25 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Semantic Release

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.2
with:
fetch-depth: 0

# Run semantic release:
# - Update CHANGELOG.md
# - Update version in code
# - Create git tag
# - Create Github release
# - Publish to PyPI
- name: Python Semantic Release
uses: browniebroke/python-semantic-release@feat/changelog-md-file
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test

on:
push:
branches:
- main
pull_request:

jobs:
test:
strategy:
fail-fast: false
matrix:
script:
- flake8 --config=setup.cfg
- black --check .
- pyupgrade --py3-plus `find . -name "*.py"`
- isort -c -v .
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.2
- name: Set up Python
uses: actions/setup-python@v2.1.2
with:
python-version: 3.8
- name: Install Dependencies
run: |
python -m pip install -U pip
pip install -r requirements.txt
- run: ${{ matrix.script }}

commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2.1.0
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v3.0.0
hooks:
- id: commitlint
stages: [ commit-msg ]
additional_dependencies: ['@commitlint/config-conventional']
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
hooks:
- id: pyupgrade
args: [--py3-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.5.3
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
# disabled due to bump2commit compatibility
# - id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: debug-statements
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
args: [--config=setup.cfg]
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.8-slim

# Create app directory
WORKDIR /app

# Copy requiremnts file
COPY requirements.txt requirements.txt

# Install dependencies
RUN pip install -r requirements.txt

# Copies source code
COPY src /app

# Run your code
ENTRYPOINT ["python", "/app/app.py"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Bruno Alla

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Hacktoberfest Labeler Action

A Github Action to add labels based on other labels.

## Usage

A workflow you can run during the month of October to add the `hacktoberfest` label to all the issues flagged as `good first issue`:

```yaml
name: Hacktoberfest

on:
schedule:
- cron: "0 0 * 10 *"

jobs:
example:
runs-on: ubuntu-latest

steps:
- uses: browniebroke/hacktoberfest-labeler-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```
35 changes: 35 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Hacktoberfest Labeler Action'
description: 'A Github Action to label issues for Hacktoberfest'
branding:
icon: tag
color: orange

### Action inputs (see also args below)
inputs:
github_token:
description: 'Github token to use'
required: true
edit_label_name:
description: 'The label name to edit'
required: false
default: 'hacktoberfest'
edit_label_color:
description: 'The label color'
required: false
default: 'ffa663'
edit_label_description:
description: 'The label description'
required: false
default: 'Good issues for Hacktoberfest'
filter_label:
description: 'The label to use for filtering issues'
required: false
default: 'good first issue'
revert:
description: 'If the true the label will be removed instead of added'
required: false
default: '0'

runs:
using: 'docker'
image: 'Dockerfile'
Loading

0 comments on commit 0c2e973

Please sign in to comment.