feat: Add GH checks and templates (#222)

This commit is contained in:
Maksym Vlasov 2021-09-11 10:47:56 +03:00 committed by GitHub
commit 53a866e775
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 326 additions and 11 deletions

27
.github/workflows/pre-commit.yaml vendored Normal file
View file

@ -0,0 +1,27 @@
name: Common issues check
on: [pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Get changed files
id: file_changes
run: |
export DIFF=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }})
echo "Diff between ${{ github.base_ref }} and ${{ github.sha }}"
echo "::set-output name=files::$( echo "$DIFF" | xargs echo )"
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Execute pre-commit
uses: pre-commit/action@v2.0.0
env:
SKIP: no-commit-to-branch
with:
token: ${{ secrets.GITHUB_TOKEN }}
extra_args: --color=always --show-diff-on-failure --files ${{ steps.file_changes.outputs.files }}

34
.github/workflows/stale-actions.yaml vendored Normal file
View file

@ -0,0 +1,34 @@
name: "Mark or close stale issues and PRs"
on:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Staling issues and PR's
days-before-stale: 30
stale-issue-label: lifecycle/stale
stale-pr-label: lifecycle/stale
stale-issue-message: |
This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days
stale-pr-message: |
This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days
# Not stale if have this labels
exempt-issue-labels: kind/bug,lifecycle/active,lifecycle/frozen
exempt-pr-labels: kind/bug,lifecycle/active,lifecycle/frozen
# If unstale
labels-to-remove-when-unstale: lifecycle/stale
# Close issue operations
# Label will be automatically removed if the issues are no longer closed nor locked.
days-before-close: 10
close-issue-label: lifecycle/rotten
delete-branch: true
close-issue-message: This issue was automatically closed because of stale in 10 days
close-pr-message: This PR was automatically closed because of stale in 10 days