From 09de08aec06bca0c0c5c26959eb24a8a757e779b Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Fri, 23 Oct 2020 10:07:36 +0200 Subject: [PATCH] Auto fix images and JSON. Lint YAML. --- .github/workflows/autofix.yaml | 69 +++++++++++++++++++++++++++++++--- .github/workflows/lint.yaml | 14 +++++++ 2 files changed, 77 insertions(+), 6 deletions(-) diff --git a/.github/workflows/autofix.yaml b/.github/workflows/autofix.yaml index 61955db..74e3a91 100644 --- a/.github/workflows/autofix.yaml +++ b/.github/workflows/autofix.yaml @@ -37,6 +37,33 @@ jobs: commit_message: "[lint] Update TOC." file_pattern: readme.md + json: + name: Format JSON files and create a PR + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.3 + - name: Install linter + run: | + sudo npm install jsonlint -g + - name: Lint + run: > + find ./ -type f -name '*.json' -print -exec + jsonlint --in-place "{}" \; + - uses: peter-evans/create-pull-request@v3 + with: + author: "Kevin Deldycke " + commit-message: "[autofix] Format JSON content" + title: "[autofix] Format JSON content" + body: > + [Auto-generated on run + #${{ github.run_id }}](https://github.com/${{ github.repository + }}/actions/runs/${{ github.run_id }}) as defined by [workflow + action](https://github.com/${{ github.repository + }}/blob/${{ github.base_ref }}/.github/workflows/autofix.yaml). + labels: CI/CD + assignees: kdeldycke + branch: format-json + typos: name: Fix typos and create a PR runs-on: ubuntu-latest @@ -46,11 +73,41 @@ jobs: - uses: peter-evans/create-pull-request@v3 with: author: "Kevin Deldycke " - commit-message: "Fix typo." - title: "Typo" + commit-message: "[autofix] Typo" + title: "[autofix] Typo" body: > - [Auto-generated on run #${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - as defined by [workflow action](https://github.com/${{ github.repository }}/blob/develop/.github/workflows/autofix.yaml). - labels: "typo" + [Auto-generated on run + #${{ github.run_id }}](https://github.com/${{ github.repository + }}/actions/runs/${{ github.run_id }}) as defined by [workflow + action](https://github.com/${{ github.repository + }}/blob/${{ github.base_ref }}/.github/workflows/autofix.yaml). + labels: CI/CD, documentation assignees: kdeldycke - branch: fix-typo + branch: autofix-typo + + images: + name: Optimize images + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.3 + - uses: calibreapp/image-actions@1.1.0 + id: image_actions + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + compressOnly: true + - uses: peter-evans/create-pull-request@v3 + with: + author: "Kevin Deldycke " + commit-message: "[autofix] Optimize images" + title: "[autofix] Optimize images" + body: > + [Auto-generated on run + #${{ github.run_id }}](https://github.com/${{ github.repository + }}/actions/runs/${{ github.run_id }}) as defined by [workflow + action](https://github.com/${{ github.repository + }}/blob/${{ github.base_ref }}/.github/workflows/autofix.yaml). + %0A + ${{ steps.image_actions.outputs.markdown }} + labels: CI/CD, documentation + assignees: kdeldycke + branch: optimize-images diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e3b6456..7176d5c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -29,3 +29,17 @@ jobs: - run: | npx awesome-lint --version npx awesome-lint + + lint-yaml: + name: Lint YAML files + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.3 + - uses: actions/setup-python@v2.1.4 + - name: Install linter + run: | + python -m pip install --upgrade pip + python -m pip install yamllint + - name: Lint + run: | + yamllint .