From 744a0674682f2e68a7c8ee42fa0da0e0930e163a Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 4 May 2023 15:40:11 +0300 Subject: [PATCH] Fix: Linting, stale permissions, tweaks --- .editorconfig | 3 +++ .github/workflows/composer-install.yml | 4 ++-- .github/workflows/compress-images.yml | 2 +- .github/workflows/dependency-review.yml | 6 +++--- .github/workflows/laravel-phpunit.yml | 2 +- .github/workflows/pr-compress-images.yml | 8 ++++---- .github/workflows/stale.yml | 6 ++++++ .github/workflows/sync-labels-to-own-projects.yml | 2 +- .shellcheckrc | 1 + .yamllint.yml | 8 ++++---- README.md | 14 ++++++++++---- 11 files changed, 36 insertions(+), 20 deletions(-) create mode 100644 .shellcheckrc diff --git a/.editorconfig b/.editorconfig index 3586281..bc4073d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -39,3 +39,6 @@ tab_width = 4 [{*.tf,*.tfvars}] tab_width = 4 + +[*.md,.github/workflows/*.yml] +max_line_length = 300 diff --git a/.github/workflows/composer-install.yml b/.github/workflows/composer-install.yml index 89a30b3..aa9336c 100644 --- a/.github/workflows/composer-install.yml +++ b/.github/workflows/composer-install.yml @@ -5,8 +5,8 @@ on: workflow_dispatch: pull_request: paths: - - 'composer.json' - - 'composer.lock' + - "composer.json" + - "composer.lock" jobs: ComposerInstall: diff --git a/.github/workflows/compress-images.yml b/.github/workflows/compress-images.yml index cc95dfd..293db73 100644 --- a/.github/workflows/compress-images.yml +++ b/.github/workflows/compress-images.yml @@ -5,7 +5,7 @@ name: Compress Images on Demand on: workflow_dispatch: schedule: - - cron: '00 23 * * 0' + - cron: "00 23 * * 0" jobs: CompressOnDemandOrSchedule: name: calibreapp/image-actions diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index bcf87f2..712386a 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -8,7 +8,7 @@ # # Source repository: https://github.com/actions/dependency-review-action # Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement -name: 'Dependency Review' +name: "Dependency Review" on: [pull_request] @@ -19,8 +19,8 @@ jobs: dependency-review: runs-on: ubuntu-latest steps: - - name: 'Checkout Repository' + - name: "Checkout Repository" uses: actions/checkout@v3 - - name: 'Dependency Review' + - name: "Dependency Review" uses: actions/dependency-review-action@v3 diff --git a/.github/workflows/laravel-phpunit.yml b/.github/workflows/laravel-phpunit.yml index 3f31d61..ab68e9d 100644 --- a/.github/workflows/laravel-phpunit.yml +++ b/.github/workflows/laravel-phpunit.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: "8.1" - uses: actions/checkout@v3 diff --git a/.github/workflows/pr-compress-images.yml b/.github/workflows/pr-compress-images.yml index b185d98..f508e5e 100644 --- a/.github/workflows/pr-compress-images.yml +++ b/.github/workflows/pr-compress-images.yml @@ -5,10 +5,10 @@ on: # Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed. # See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference. paths: - - '**.jpg' - - '**.jpeg' - - '**.png' - - '**.webp' + - "**.jpg" + - "**.jpeg" + - "**.png" + - "**.webp" jobs: CompressInPR: # Only run on Pull Requests within the same repository, and not from forks. diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 22434df..24c55e3 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,6 +8,12 @@ on: workflow_call: workflow_dispatch: + +permissions: + contents: write # only for delete-branch option + issues: write + pull-requests: write + jobs: stale: name: 🧹 Clean up stale issues and PRs diff --git a/.github/workflows/sync-labels-to-own-projects.yml b/.github/workflows/sync-labels-to-own-projects.yml index 77e31b1..b175eb6 100644 --- a/.github/workflows/sync-labels-to-own-projects.yml +++ b/.github/workflows/sync-labels-to-own-projects.yml @@ -29,7 +29,7 @@ jobs: --source \ --limit 25 \ --json nameWithOwner -q '.[] | .nameWithOwner' \ - | sed 's|\"||' + | sed 's|\"||' )" EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..e6699e9 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +disable=SC2129,SC2086 diff --git a/.yamllint.yml b/.yamllint.yml index 0df56c7..31ff9db 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -4,12 +4,12 @@ extends: default ignore-from-file: .gitignore yaml-files: - - '*.yaml' - - '*.yml' - - '.yamllint.yml' + - "*.yaml" + - "*.yml" + - ".yamllint.yml" rules: line-length: - max: 120 + max: 300 level: warning truthy: disable diff --git a/README.md b/README.md index 13e509c..4728ca2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ My Shared GitHub Actions & Configurations. ## Actions -Actions should be linked using the `uses` keyword. Read more from the Reusing workflows article [Calling a reusable workflow](https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow) and [jobs..steps[*].uses](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses) configuration documentation. +Actions should be linked using the `uses` keyword. Read more from the Reusing workflows +article [Calling a reusable workflow][reusable] and [jobs..steps[\*].uses][jobs] +configuration documentation. ```yml jobs: @@ -14,7 +16,7 @@ jobs: ReusableMatrixJobForComposerInstall: strategy: matrix: - target: ['8.0', '8.1', '8.2'] + target: ["8.0", "8.1", "8.2"] uses: ivuorinen/.github/workflows/composer-install.yml@main with: php-versions: ${{ matrix.target }} @@ -24,12 +26,16 @@ jobs: ### Renovate config -Go through [the onboarding process](https://docs.renovatebot.com/getting-started/installing-onboarding/) and save the following snippet as `.github/renovate.json`. +Go through [the onboarding process][onboarding] and save +the following snippet as `.github/renovate.json`. ```json { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["github>ivuorinen/.github:renovate-config"] } - ``` + +[reusable]: https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow +[jobs]: https://docs.github.com/en/actions/using-workflows/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses +[onboarding]: https://docs.renovatebot.com/getting-started/installing-onboarding