From 61135f61fac15f79c3598774e3352120ea2bb12b Mon Sep 17 00:00:00 2001 From: Bradley <41597815+userbradley@users.noreply.github.com> Date: Sat, 30 Dec 2023 02:15:53 +0000 Subject: [PATCH] setting up some useful CI --- .github/workflows/broken-link-checker.yaml | 23 ++++++++++++++++++ .github/workflows/pre-commit.yaml | 8 +++++++ .pre-commit-config.yaml | 27 ++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .github/workflows/broken-link-checker.yaml create mode 100644 .github/workflows/pre-commit.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/broken-link-checker.yaml b/.github/workflows/broken-link-checker.yaml new file mode 100644 index 0000000..0b09bc8 --- /dev/null +++ b/.github/workflows/broken-link-checker.yaml @@ -0,0 +1,23 @@ +name: Broken Link Checker +on: + workflow_dispatch: + schedule: + - cron: "00 18 * * *" +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Check Links + uses: lycheeverse/lychee-action@v1.8.0 + with: + args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst' --exclude-mail + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Create Issue From File + uses: peter-evans/create-issue-from-file@v4.0.1 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: Broken Link diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..22ddb2d --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,8 @@ +name: Pre-commit +on: pull_request +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..68c7858 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: no-commit-to-branch + name: Ensure commits are only made to feature branches + args: ['-b', 'main'] + - id: end-of-file-fixer + name: Ensure files have end of file + - id: trailing-whitespace + name: Trims extra whitespaces + - id: check-toml + name: Checks TOML files + - repo: https://github.com/google/yamlfmt + rev: v0.10.0 + hooks: + - id: yamlfmt + name: Yaml Formatting + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.26.3 + hooks: + - id: check-github-actions + name: GitHub actions check + - id: check-dependabot + name: GitHub Workflows + - id: check-dependabot + name: Dependabot