Skip to content

Commit

Permalink
ci: update workflows to 1.3.25 (#30)
Browse files Browse the repository at this point in the history
# Description

This PR updates all workflows to the latest version.

# Verification

Done by the workflows in this feature branch, except for the release
workflow.
  • Loading branch information
kayman-mk authored Nov 25, 2024
1 parent d1637d0 commit cc81be9
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 295 deletions.
107 changes: 4 additions & 103 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,106 +6,7 @@ on:
pull_request:

jobs:
find-changes:
runs-on: ubuntu-latest
steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
json:
- '**/*.json'
markdown:
- '**/*.md'
renovate-config:
- 'renovate.json'
- 'default.json'
workflow:
- '.github/workflows/*.yml'
- '.github/workflows/*.yaml'
yaml:
- '**/*.yaml'
- '**/*.yml'
outputs:
json: ${{ steps.changes.outputs.json }}
markdown: ${{ steps.changes.outputs.markdown }}
renovate-config: ${{ steps.changes.outputs.renovate-config }}
workflow: ${{ steps.changes.outputs.workflow }}
yaml: ${{ steps.changes.outputs.yaml }}

lint-json:
runs-on: ubuntu-latest
continue-on-error: true
if: needs.find-changes.outputs.json == 'true'
needs: find-changes
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Run JSON Lint
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/json-lint/master/pipeline.sh)

lint-markdown:
runs-on: ubuntu-latest
continue-on-error: true
if: needs.find-changes.outputs.markdown == 'true'
needs: find-changes
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Validate Markdown file
run: |
npm install -g markdownlint-cli
markdownlint -c .config/markdownlint.yml -i CHANGELOG.md "**/*.md"
lint-renovate:
runs-on: ubuntu-latest
continue-on-error: true
if: needs.find-changes.outputs.renovate-config == 'true'
needs: find-changes
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: suzuki-shunsuke/github-action-renovate-config-validator@b54483862375f51910a60c4f498e927d4f3df466 # v1.0.1

lint-shell:
name: Check shell scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: ShellCheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0

lint-workflow:
runs-on: ubuntu-latest
continue-on-error: true
needs: find-changes
if: needs.find-changes.outputs.workflow == 'true'
container:
image: rhysd/actionlint:1.6.27@sha256:d84eca815fc24f72546ec1f2f416d9500ad3349ce7db098cf7a52256f5fd4384
options: --cpus 1 --user root
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Validate Github workflows
run: |
mkdir .git
actionlint -color
lint-yaml:
runs-on: ubuntu-latest
continue-on-error: true
needs: find-changes
if: needs.find-changes.outputs.yaml == 'true'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: yaml-lint
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
with:
config_file: .config/yamllint.yml
strict: true
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_linter_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
49 changes: 0 additions & 49 deletions .github/workflows/pull-request.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: "Pull Request"

# yamllint disable-line rule:truthy
on:
pull_request_target:
types:
- opened
- edited
- synchronize
branches-ignore:
- "release-please--branches--*"

jobs:
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_pull_request_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
25 changes: 5 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Create a release
name: Release

# yamllint disable-line rule:truthy
on:
Expand All @@ -8,22 +8,7 @@ on:
- main

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
id: app-token
with:
app-id: ${{ vars.GET_TOKEN_APP_ID }}
private-key: ${{ secrets.GET_TOKEN_APP_PRIVATE_KEY }}
# bootstrap-sha and release-as needs to be removed after first release
- name: Release
# yamllint disable-line rule:line-length
uses: google-github-actions/release-please-action@a2d8d683f209466ee8c695cd994ae2cf08b1642d # ratchet:google-github-actions/release-please-action@v3
with:
release-type: python
token: ${{ steps.app-token.outputs.token }}
pull-request-header: ''
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_release_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
14 changes: 14 additions & 0 deletions .github/workflows/release_dry_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Release Test

# yamllint disable-line rule:truthy
on:
push:
branches:
- release-dry-run

jobs:
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_release_dry_run_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/renovate_auto_approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Approve all Renovate PRs automatically

# yamllint disable-line rule:truthy
on:
pull_request_target

jobs:
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_renovate_auto_approve_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
17 changes: 0 additions & 17 deletions .github/workflows/renvovate-auto-approve.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/slash-ops-command-help.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/slash-ops-comment-dispatch.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/slash_ops_command_help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Execute ChatOps command

# yamllint disable-line rule:truthy
on:
repository_dispatch:
types:
- help-command

jobs:
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_slash_ops_command_help_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
14 changes: 14 additions & 0 deletions .github/workflows/slash_ops_comment_dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: PR commented

# yamllint disable-line rule:truthy
on:
issue_comment:
types:
- created

jobs:
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_slash_ops_comment_dispatch_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
12 changes: 4 additions & 8 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ on:
pull_request:

jobs:
cspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: streetsidesoftware/cspell-action@ca4bb065dd09aca9c90c935f7dc9bb625985226c # v6.1.0
with:
config: .config/cspell.json
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_spelling_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
19 changes: 4 additions & 15 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@ on:
- cron: "25 2 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
with:
# yamllint disable rule:line-length
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days."
stale-pr-message: "This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days."
close-issue-message: "This issue was closed because it has been stalled for 10 days with no activity."
close-pr-message: "This PR was closed because it has been stalled for 10 days with no activity."
# yamllint enable rule:line-length
days-before-stale: 30
days-before-close: 10
stale-issue-label: "stale"
stale-pr-label: "stale"
default:
# yamllint disable-line rule:line-length
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_stale_callable.yml@31e83cf3419b7230171cea9cd2e97f83bc04488f # 1.3.25
secrets: inherit
Loading

0 comments on commit cc81be9

Please sign in to comment.