Skip to content

Commit

Permalink
action lint (#79)
Browse files Browse the repository at this point in the history
* Fix feedback from actionlint

* Add actionlint to GitHub Actions workflow

* Fix yamllinting

* Add YAML linting to GitHub Actions workflow
  • Loading branch information
arnested authored Dec 22, 2024
1 parent 353ddbd commit 591bc5f
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 29 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
blank_issues_enabled: true
contact_links:
- name: Ask a question or get support
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2
updates:
- package-ecosystem: docker
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/anchore-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
name: Anchore Container Scan

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main
schedule:
- cron: '17 7 * * 5'

Expand All @@ -16,17 +19,17 @@ jobs:
Anchore-Build-Scan:
runs-on: ubuntu-24.04
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag localbuild/testimage:latest
- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
uses: anchore/scan-action@v6
id: anchore_scan
with:
image: "localbuild/testimage:latest"
fail-build: false
- name: Upload Anchore Scan Report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.anchore_scan.outputs.sarif }}
- name: Checkout the code
uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag localbuild/testimage:latest
- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
uses: anchore/scan-action@v6
id: anchore_scan
with:
image: "localbuild/testimage:latest"
fail-build: false
- name: Upload Anchore Scan Report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.anchore_scan.outputs.sarif }}
1 change: 1 addition & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: 'Dependency Review'
on: [pull_request]

Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Lint
on: pull_request

Expand All @@ -17,6 +18,22 @@ jobs:
name: markdown
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Run markdownlint
uses: DavidAnson/markdownlint-cli2-action@v18
- uses: actions/checkout@v4
- name: Run markdownlint
uses: DavidAnson/markdownlint-cli2-action@v18

actionlint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1

yamllint:
name: Yamllint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Run Yamllint
uses: frenck/action-yamllint@v1.5.0
with:
strict: true
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Release
on:
workflow_run:
Expand All @@ -23,29 +24,29 @@ jobs:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
- name: Major version tag
id: major-version
if: ${{ steps.version.outputs.new_tag }} != ""
if: ${{ steps.version.outputs.new_tag }}
uses: actions/github-script@v7
with:
script: |
core.setOutput('tag', '${{ steps.version.outputs.new_tag }}'.split('.')[0])
- name: Tag ${{ steps.major-version.outputs.tag }}
if: ${{ steps.version.outputs.new_tag }} != ""
if: ${{ steps.version.outputs.new_tag }}
run: |
git tag --force ${{ steps.major-version.outputs.tag }}
git push origin ${{ steps.major-version.outputs.tag }} --force
- name: Get current date
if: ${{ steps.version.outputs.new_tag }} != ""
if: ${{ steps.version.outputs.new_tag }}
id: date
run: echo "::set-output name=date::$(date --iso-8601)"
run: echo "name=date::$(date --iso-8601)" >> "$GITHUB_STATE"
- name: Get shoutrrr version
if: ${{ steps.version.outputs.new_tag }} != ""
if: ${{ steps.version.outputs.new_tag }}
id: shoutrrr
run: echo "::set-output name=version::$(docker run --rm $(docker build --quiet - < Dockerfile) --version)"
run: echo "name=version::$(docker run --rm "$(docker build --quiet - < Dockerfile)" --version)" >> "$GITHUB_STATE"
- name: Build full ChangeLog
if: ${{ steps.version.outputs.new_tag }} != ''
if: ${{ steps.version.outputs.new_tag }}
run: npx conventional-changelog-cli --release-count=0 --preset=eslint --outfile="${{ runner.temp }}/FullChangeLog.md"
- name: Create/update release ${{ steps.major-version.outputs.tag }}
if: ${{ steps.version.outputs.new_tag }} != ""
if: ${{ steps.version.outputs.new_tag }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -54,10 +55,10 @@ jobs:
name: ${{ steps.version.outputs.new_tag }} (${{ steps.date.outputs.date }} / ${{ steps.shoutrrr.outputs.version }})
bodyFile: ${{ runner.temp }}/FullChangeLog.md
- name: Build ChangeLog
if: ${{ steps.version.outputs.new_tag }} != ''
if: ${{ steps.version.outputs.new_tag }}
run: npx conventional-changelog-cli --release-count=2 --outfile="${{ runner.temp }}/ChangeLog.md"
- name: Create release ${{ steps.version.outputs.new_tag }}
if: ${{ steps.version.outputs.new_tag }} != ""
if: ${{ steps.version.outputs.new_tag }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Build and test
on:
pull_request:
Expand Down
14 changes: 14 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
extends: default

rules:
indentation:
spaces: 2
line-length: disable
truthy:
check-keys: false
braces:
min-spaces-inside: 1
max-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: 'Shoutrrr action'
description: 'Notifications using https://containrrr.dev/shoutrrr'
branding:
Expand Down

0 comments on commit 591bc5f

Please sign in to comment.