Skip to content

Commit

Permalink
Added actionlint to validate workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo committed Feb 2, 2024
1 parent fc41889 commit 3f8d47c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
File renamed without changes.
17 changes: 15 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Build
on:
workflow_dispatch:
workflow_call:
Expand All @@ -23,7 +23,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup host
uses: ./.github/workflows/setup-host
uses: ./.github/actions/setup-host
- name: Test & Build
run: ./gradlew -s build
- name: Publish Test Report
Expand All @@ -33,3 +33,16 @@ jobs:
report_paths: '**/build/test-results/*/TEST-*.xml'
- name: Coverage report
uses: codecov/codecov-action@v3

actionlint:
name: Validate Workflows
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download actionlint
shell: bash
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
- name: Check workflow files
shell: bash
run: ./actionlint -color -format '{{range $err := .}}::error file={{$err.Filepath}},line={{$err.Line}},col={{$err.Column}}::{{$err.Message}}%0A```%0A{{replace $err.Snippet "\\n" "%0A"}}%0A```\n{{end}}' -ignore 'SC2016:'
7 changes: 3 additions & 4 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
name: Dependabot auto-merge
on:
on:
pull_request:
types: [ opened, synchronize, reopened, labeled ]

Expand All @@ -14,7 +14,6 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'dependencies') }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --rebase "$PR_URL"
run: gh pr merge --auto --rebase ${{ github.event.pull_request.html_url }}
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ github.token }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: Release
on:
release:
types: [published]
Expand All @@ -18,7 +18,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup host
uses: ./.github/workflows/setup-host
uses: ./.github/actions/setup-host
- name: Publish
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-gradle-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup host
uses: ./.github/workflows/setup-host
uses: ./.github/actions/setup-host
- name: Update Gradle Wrapper
uses: gradle-update/update-gradle-wrapper-action@v1
with:
Expand Down

0 comments on commit 3f8d47c

Please sign in to comment.