Add workflow for lint, stale
This commit is contained in:
parent
a895866fb7
commit
ec36966332
54
.github/workflows/lint.yml
vendored
Normal file
54
.github/workflows/lint.yml
vendored
Normal 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
27
.github/workflows/stale.yml
vendored
Normal 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.
|
||||
Loading…
Reference in New Issue
Block a user