Fix: Linting, stale permissions, tweaks

This commit is contained in:
2023-05-04 15:40:11 +03:00
parent 15ac8b6bef
commit 744a067468
11 changed files with 36 additions and 20 deletions

View File

@@ -39,3 +39,6 @@ tab_width = 4
[{*.tf,*.tfvars}] [{*.tf,*.tfvars}]
tab_width = 4 tab_width = 4
[*.md,.github/workflows/*.yml]
max_line_length = 300

View File

@@ -5,8 +5,8 @@ on:
workflow_dispatch: workflow_dispatch:
pull_request: pull_request:
paths: paths:
- 'composer.json' - "composer.json"
- 'composer.lock' - "composer.lock"
jobs: jobs:
ComposerInstall: ComposerInstall:

View File

@@ -5,7 +5,7 @@ name: Compress Images on Demand
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: '00 23 * * 0' - cron: "00 23 * * 0"
jobs: jobs:
CompressOnDemandOrSchedule: CompressOnDemandOrSchedule:
name: calibreapp/image-actions name: calibreapp/image-actions

View File

@@ -8,7 +8,7 @@
# #
# Source repository: https://github.com/actions/dependency-review-action # 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 # 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] on: [pull_request]
@@ -19,8 +19,8 @@ jobs:
dependency-review: dependency-review:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 'Checkout Repository' - name: "Checkout Repository"
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: 'Dependency Review' - name: "Dependency Review"
uses: actions/dependency-review-action@v3 uses: actions/dependency-review-action@v3

View File

@@ -15,7 +15,7 @@ jobs:
steps: steps:
- uses: shivammathur/setup-php@v2 - uses: shivammathur/setup-php@v2
with: with:
php-version: '8.1' php-version: "8.1"
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@@ -5,10 +5,10 @@ on:
# Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed. # 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. # See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference.
paths: paths:
- '**.jpg' - "**.jpg"
- '**.jpeg' - "**.jpeg"
- '**.png' - "**.png"
- '**.webp' - "**.webp"
jobs: jobs:
CompressInPR: CompressInPR:
# Only run on Pull Requests within the same repository, and not from forks. # Only run on Pull Requests within the same repository, and not from forks.

View File

@@ -8,6 +8,12 @@ on:
workflow_call: workflow_call:
workflow_dispatch: workflow_dispatch:
permissions:
contents: write # only for delete-branch option
issues: write
pull-requests: write
jobs: jobs:
stale: stale:
name: 🧹 Clean up stale issues and PRs name: 🧹 Clean up stale issues and PRs

View File

@@ -29,7 +29,7 @@ jobs:
--source \ --source \
--limit 25 \ --limit 25 \
--json nameWithOwner -q '.[] | .nameWithOwner' \ --json nameWithOwner -q '.[] | .nameWithOwner' \
| sed 's|\"||' | sed 's|\"||'
)" )"
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)

1
.shellcheckrc Normal file
View File

@@ -0,0 +1 @@
disable=SC2129,SC2086

View File

@@ -4,12 +4,12 @@ extends: default
ignore-from-file: .gitignore ignore-from-file: .gitignore
yaml-files: yaml-files:
- '*.yaml' - "*.yaml"
- '*.yml' - "*.yml"
- '.yamllint.yml' - ".yamllint.yml"
rules: rules:
line-length: line-length:
max: 120 max: 300
level: warning level: warning
truthy: disable truthy: disable

View File

@@ -4,7 +4,9 @@ My Shared GitHub Actions & Configurations.
## Actions ## 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.<job_id>.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.<job_id>.steps[\*].uses][jobs]
configuration documentation.
```yml ```yml
jobs: jobs:
@@ -14,7 +16,7 @@ jobs:
ReusableMatrixJobForComposerInstall: ReusableMatrixJobForComposerInstall:
strategy: strategy:
matrix: matrix:
target: ['8.0', '8.1', '8.2'] target: ["8.0", "8.1", "8.2"]
uses: ivuorinen/.github/workflows/composer-install.yml@main uses: ivuorinen/.github/workflows/composer-install.yml@main
with: with:
php-versions: ${{ matrix.target }} php-versions: ${{ matrix.target }}
@@ -24,12 +26,16 @@ jobs:
### Renovate config ### 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 ```json
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>ivuorinen/.github:renovate-config"] "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