Skip to content

Commit

Permalink
Add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaiola committed Sep 28, 2023
1 parent d66824f commit 52e9ada
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 135 deletions.
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Set update schedule for GitHub Actions

version: 2
Expand All @@ -7,4 +8,4 @@ updates:
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
interval: "daily"
4 changes: 4 additions & 0 deletions .github/super-linter.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
VALIDATE_ALL_CODEBASE=false
VALIDATE_MARKDOWN=true
VALIDATE_YAML=true
VALIDATE_JAVASCRIPT_ES=true
56 changes: 56 additions & 0 deletions .github/workflows/close-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Close stale issues and PRs

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub Actions Documentation
# https://docs.github.com/en/github-ae@latest/actions

on:
schedule:
# Run daily at 6:30 PM UTC
- cron: '30 18 * * *'
# or on button click
workflow_dispatch:

env:
ISSUE_WARN_MESSAGE: >
This issue is stale because it has been open 90 days with no activity.
Remove stale label or comment or this will be closed in 7 days.
PR_WARN_MESSAGE: >
This PR is stale because it has been open 45 days with no activity.
ISSUE_CLOSE_MESSAGE: >
This issue was closed because it has been stalled for 7 days with no
activity. Feel free to reopen if this issue is still relevant, or to ping
the collaborator who labelled it stalled if you have any questions.
jobs:
stale:
runs-on: ubuntu-latest
permissions:
# https://github.com/actions/stale#recommended-permissions
issues: write
pull-requests: write

steps:
# Close Stale Issues and PRs
# https://github.com/actions/stale
-
uses: actions/stale@v8
with:
# Run the stale workflow as dry-run (no actions will be taken)
# debug-only: true
stale-issue-label: stale
stale-issue-message: ${{ env.ISSUE_WARN_MESSAGE }}
stale-pr-message: ${{ env.PR_WARN_MESSAGE }}
close-issue-message: ${{ env.ISSUE_CLOSE_MESSAGE }}
days-before-stale: 90
days-before-pr-stale: 45
days-before-close: 7
# Never close a PR
days-before-pr-close: -1
51 changes: 0 additions & 51 deletions .github/workflows/code-linting.yml

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/code-scanning.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/lint-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
name: Lint code base

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub Actions Documentation
# https://docs.github.com/en/github-ae@latest/actions

on:
# Run on all pushes (except on master/main branch)
push:
branches-ignore: [master, main]
# Remove the line above to run when pushing to master
# PRs on master/main branch
pull_request:
branches: [master, main]
# or on button click
workflow_dispatch:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs
inputs:
ref:
# The branch, tag or SHA to checkout for linting. If empty, check out
# the repository that triggered the workflow.
description: |
The branch, tag or SHA to checkout (empty for current branch)
required: false
type: string
# or on calling as reusable workflow
workflow_call:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputs
inputs:
ref:
# The branch, tag or SHA to checkout for linting. If empty, check out
# the repository that triggered the workflow.
description: |
The branch, tag or SHA to checkout (empty for current branch)
required: false
type: string

jobs:
lint:
name: Lint code base
runs-on: ubuntu-latest
# Grant status permission for MULTI_STATUS
permissions:
contents: read
packages: read
statuses: write

steps:
# Checkout a repository, so the workflow can access it
# https://github.com/actions/checkout
-
name: Checkout repository (no ref input)
uses: actions/checkout@v4
if: ${{ inputs.ref == '' }}
with:
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0

-
name: Checkout repository (with ref input)
uses: actions/checkout@v4
if: ${{ inputs.ref != '' }}
with:
ref: '${{ inputs.ref }}'
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0

# Load environment variables before running the GitHub Actions job
# https://github.com/super-linter/super-linter/blob/main/docs/run-linter-locally.md
-
run: cat .github/super-linter.env >> "$GITHUB_ENV"

# Run Linter against code base
# https://github.com/super-linter/super-linter
-
name: Run Super-Linter on code base
#uses: github/super-linter@v5
uses: super-linter/super-linter/slim@v5
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 52e9ada

Please sign in to comment.