From ca225ccc2a9506e36d3fc411af139b65547c1c5a Mon Sep 17 00:00:00 2001 From: Martijn Date: Thu, 25 Jan 2024 22:28:20 +0100 Subject: [PATCH] Update workflows and super-linter (#674) * Bump actions/checkout to v4 * Bump super-linter to v5 slim * Fix default branch name * Only run on push to master or release branches Also re-disables linting entire codebase * Satisfy linter * Run the linter in more cases for PRs --- .github/workflows/linter.yml | 28 ++++++++++++++++------------ .github/workflows/main.yml | 3 ++- .github/workflows/prchecks.yml | 3 ++- .github/workflows/svgo.yml | 5 +++-- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index fa13349802..427ddc4457 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -6,18 +6,16 @@ ################################# name: Lint Code Base -# -# Documentation: -# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions -# - ############################# # Start the job on all push # ############################# -on: +on: # yamllint disable-line rule:truthy push: - # Remove the line above to run when pushing to master + branches: + - 'master' + - 'releases/**' pull_request: + types: [opened, edited, synchronize, reopened, review_requested] ############### # Set the Job # @@ -29,6 +27,12 @@ jobs: # Set the agent to run on runs-on: ubuntu-latest + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + ################## # Load all steps # ################## @@ -37,18 +41,18 @@ jobs: # Checkout the code base # ########################## - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - # Full git history is needed to get a proper list of changed files within `super-linter` + # Full git history is needed to get a proper list of changed files + # within `super-linter` fetch-depth: 0 ################################ # Run Linter against code base # ################################ - name: Lint Code Base - uses: github/super-linter@v4 + uses: super-linter/super-linter/slim@v5 env: VALIDATE_ALL_CODEBASE: false - # Change to 'master' if your main branch differs - DEFAULT_BRANCH: main + DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6bdb807fd8..d847ea1359 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,4 @@ +--- name: Deploy to GitHub Pages on: @@ -15,7 +16,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node env uses: actions/setup-node@v3.6.0 diff --git a/.github/workflows/prchecks.yml b/.github/workflows/prchecks.yml index 4711b780be..0456038705 100644 --- a/.github/workflows/prchecks.yml +++ b/.github/workflows/prchecks.yml @@ -1,3 +1,4 @@ +--- name: PR Checks on: @@ -16,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node env uses: actions/setup-node@v3.6.0 diff --git a/.github/workflows/svgo.yml b/.github/workflows/svgo.yml index 7e6cc8bf48..b4a579ae21 100644 --- a/.github/workflows/svgo.yml +++ b/.github/workflows/svgo.yml @@ -1,3 +1,4 @@ +--- # GitHub Action uses SVGO to Minify and removeDimensions of SVG files name: Optimize SVG Files @@ -14,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Optimize SVGs uses: ericcornelissen/svgo-action@v3 id: svgo @@ -25,4 +26,4 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v4 if: ${{steps.svgo.outputs.DID_OPTIMIZE}} with: - commit_message: Optimize ${{steps.svgo.outputs.OPTIMIZED_COUNT}} SVG(s) + commit_message: Optimize ${{steps.svgo.outputs.OPTIMIZED_COUNT}} SVG(s) # yamllint disable-line rule:line-length