Add workflow for lint, stale

This commit is contained in:
Fredrik Baberg 2023-01-13 22:41:53 +01:00
parent a895866fb7
commit ec36966332
2 changed files with 81 additions and 0 deletions

54
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,54 @@
---
# yamllint disable rule:truthy
name: Lint
env:
HADOLINT_VERSION: v1.17.2
SHELLCHECK_OPTS: -e SC1008 -s bash
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
hadolint:
runs-on: ubuntu-latest
name: hadolint
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Run linter
id: changed_files
run: |
shopt -s globstar
for dockerfile in **/Dockerfile; do
echo "Linting: $dockerfile"
docker run --rm -i \
-v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \
hadolint/hadolint:${{ env.HADOLINT_VERSION }} < "$dockerfile"
done
yamllint:
runs-on: ubuntu-latest
name: YAMLLint
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Run YAMLLint
uses: frenck/action-yamllint@v1.3
shellcheck:
runs-on: ubuntu-latest
name: ShellCheck
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Run linter
uses: ludeeus/action-shellcheck@1.1.0

27
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,27 @@
---
# yamllint disable rule:truthy
name: Stale
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: 30 days stale issues
uses: actions/stale@v7.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 30
days-before-issue-close: 7
operations-per-run: 150
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "pinned,security,Help wanted"
stale-issue-message: >
This issue has been automatically marked as stale because it has
not had recent activity. It will be closed if no further activity
occurs. Thank you for your contributions.