From d168ddf5a23cdf15e0aaa7fd4ba1d5c6d54feaa9 Mon Sep 17 00:00:00 2001 From: BobSaidHi <47067448+BobSaidHi@users.noreply.github.com> Date: Fri, 29 Sep 2023 22:01:38 -0700 Subject: [PATCH] Worked github actins --- .github/workflows/config/.spellConfig.yml | 18 +++ .github/workflows/config/.wordList.txt | 1 + .../workflows/config/markdownlintConfig.yml | 141 ++++++++++++++++++ .github/workflows/imageActions.yml | 58 +++++++ .github/workflows/markdownwonLinter.yml | 30 ++++ .github/workflows/spell.yml | 18 +++ 6 files changed, 266 insertions(+) create mode 100644 .github/workflows/config/.spellConfig.yml create mode 100644 .github/workflows/config/.wordList.txt create mode 100644 .github/workflows/config/markdownlintConfig.yml create mode 100644 .github/workflows/imageActions.yml create mode 100644 .github/workflows/markdownwonLinter.yml create mode 100644 .github/workflows/spell.yml diff --git a/.github/workflows/config/.spellConfig.yml b/.github/workflows/config/.spellConfig.yml new file mode 100644 index 0000000..fe25a0f --- /dev/null +++ b/.github/workflows/config/.spellConfig.yml @@ -0,0 +1,18 @@ +matrix: +- name: Markdown + aspell: + lang: en + dictionary: + wordlists: + - .github/workflows/config/.wordList.txt + encoding: utf-8 + pipeline: + - pyspelling.filters.markdown: + - pyspelling.filters.html: + comments: false + ignores: + - code + - pre + sources: + - '**/*.md' + default_encoding: utf-8 diff --git a/.github/workflows/config/.wordList.txt b/.github/workflows/config/.wordList.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.github/workflows/config/.wordList.txt @@ -0,0 +1 @@ + diff --git a/.github/workflows/config/markdownlintConfig.yml b/.github/workflows/config/markdownlintConfig.yml new file mode 100644 index 0000000..7e5676e --- /dev/null +++ b/.github/workflows/config/markdownlintConfig.yml @@ -0,0 +1,141 @@ +default: false # includes/excludes all rules by default + +# Heading levels should only increment by one level at a time +MD001: true + +# Heading style +MD003: true + +# Unordered list style +MD004: true + +# Inconsistent indentation for list items at the same level +MD005: true + +# Consider starting bulleted lists at the beginning of the line +MD006: true + +# Unordered list indentation +MD007: true + +# Trailing spaces +MD009: true + +# Hard tabs +MD010: true + +# Reversed link syntax +MD011: true + +# Multiple consecutive blank lines +MD012: true + +# Line length +MD013: false + +# Dollar signs used before commands without showing output +MD014: false + +# No space after hash on atx style heading +MD018: true + +# Multiple spaces after hash on atx style heading +MD019: true + +# No space inside hashes on closed atx style heading +MD020: true + +# Multiple spaces inside hashes on closed atx style heading +MD021: true + +# Headings should be surrounded by blank lines +MD022: true + +# Headings must start at the beginning of the line +MD023: true + +# Multiple headings with the same content +MD024: + allow_different_nesting: true + +# Multiple top level headings in the same document +MD025: true + +# Trailing punctuation in heading +MD026: true + +# Multiple spaces after blockquote symbol +MD027: true + +# Blank line inside blockquote +MD028: false + +# Ordered list item prefix +MD029: + style: 'one_or_ordered' + +# Spaces after list markers +MD030: true + +# Fenced code blocks should be surrounded by blank lines +MD031: true + +# Lists should be surrounded by blank lines +MD032: true + +# Inline HTML +MD033: false + +# Bare URL used +MD034: true + +# Horizontal rule style +MD035: + style: '---' + +# Emphasis used instead of a heading +MD036: true + +# Spaces inside emphasis markers +MD037: true + +# Spaces inside code span elements +MD038: true + +# Spaces inside link text +MD039: true + +# Fenced code blocks should have a language specified +MD040: true + +# First line in file should be a top level heading +MD041: true + +# No empty links +MD042: true + +# Required heading structure +MD043: false + +# Proper names should have the correct capitalization +MD044: false + +# Images should have alternate text (alt text) +MD045: false + +# Code block style +MD046: + style: 'fenced' + +# Files should end with a single newline character +MD047: true + +# Code fence style +MD048: + style: 'backtick' + +# Custom rules: +CHANGELOG-RULE-001: true +CHANGELOG-RULE-002: true +CHANGELOG-RULE-003: true +CHANGELOG-RULE-004: true diff --git a/.github/workflows/imageActions.yml b/.github/workflows/imageActions.yml new file mode 100644 index 0000000..1990f06 --- /dev/null +++ b/.github/workflows/imageActions.yml @@ -0,0 +1,58 @@ +# Image Actions will run in the following scenarios: +# - on Pull Requests containing images (not including forks) +# - on pushing of images to `main` (for forks) +# - on demand (https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/) +# - at 11 PM every Sunday in anything gets missed with any of the above scenarios +# For Pull Requests, the images are added to the PR. +# For other scenarios, a new PR will be opened if any images are compressed. +name: Compress images +on: + pull_request: + paths: + - '**.jpg' + - '**.jpeg' + - '**.png' + - '**.webp' + push: + branches: + - master # we don't have a main branch #why it not work now? #not it + paths: + - '**.jpg' + - '**.jpeg' + - '**.png' + - '**.webp' + workflow_dispatch: + schedule: + - cron: '00 23 * * 0' +jobs: + build: + name: calibreapp/image-actions + runs-on: ubuntu-latest + # Only run on main repo on and PRs that match the main repo. + if: | + github.repository == 'frc6506/docs' && + (github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name == github.repository) + steps: + - name: Checkout Branch + uses: actions/checkout@v3 + - name: Compress Images + id: calibre + uses: calibreapp/image-actions@main + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + # For non-Pull Requests, run in compressOnly mode and we'll PR after. + compressOnly: ${{ github.event_name != 'pull_request' }} + - name: Create Pull Request + # If it's not a Pull Request then commit any changes as a new PR. + if: | + github.event_name != 'pull_request' && + steps.calibre.outputs.markdown != '' + uses: peter-evans/create-pull-request@v3 + with: + title: Auto Compress Images + branch-suffix: timestamp + commit-message: Compress Images + body: ${{ steps.calibre.outputs.markdown }} + labels: enhancement, dozer + diff --git a/.github/workflows/markdownwonLinter.yml b/.github/workflows/markdownwonLinter.yml new file mode 100644 index 0000000..cfa0b1a --- /dev/null +++ b/.github/workflows/markdownwonLinter.yml @@ -0,0 +1,30 @@ +name: Markdown Linter +on: + - push + - pull_request + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel + +jobs: + lint-changelog: + name: Lint markdown files + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Lint files + uses: docker://avtodev/markdown-lint:v1 # fastest way + with: + #rules: '.github/workflows/config/markdownlintConfig.js' #custom rules + config: '.github/workflows/config/markdownlintConfig.yml' #main config + ignore: 'pages/aboutPages.md' # multiple files must be separated with single space + + # Or using current repository as action: + +# - name: Lint changelog file +# uses: avto-dev/markdown-lint@v1 + # with: + # rules: '/lint/rules/changelog.js' + # config: '/lint/config/changelog.yml' + # args: './' diff --git a/.github/workflows/spell.yml b/.github/workflows/spell.yml new file mode 100644 index 0000000..c7da4e5 --- /dev/null +++ b/.github/workflows/spell.yml @@ -0,0 +1,18 @@ +name: Spellcheck Action +on: + - push + - pull_request + +jobs: + build: + name: Spellcheck + runs-on: ubuntu-latest + steps: + # The checkout step + - uses: actions/checkout@v3 + - uses: rojopolis/spellcheck-github-actions@0.22.1 + name: Spellcheck + with: + config_path: .github/workflows/config/.spellConfig.yml # put path to configuration file here + task_name: Markdown +