Skip to content

Commit

Permalink
Merge pull request #627 from hahwul/yaml-lint
Browse files Browse the repository at this point in the history
fix: standardize YAML formatting across workflow files
  • Loading branch information
hahwul authored Feb 4, 2025
2 parents a639f46 + 443b05d commit 6225d10
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 117 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Coverage

on:
push:
branches: [ main ]
branches: [main]
paths:
- cmd/**/*
- pkg/**/*
Expand All @@ -12,7 +12,7 @@ on:
- Dockerfile
- codecov.yml
pull_request:
branches: [ main ]
branches: [main]
paths:
- cmd/**/*
- pkg/**/*
Expand All @@ -22,12 +22,11 @@ on:
- Dockerfile
- codecov.yml
workflow_dispatch:
inputs:
logLevel:
description: 'manual run'
required: false
default: ''

inputs:
logLevel:
description: manual run
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
Expand Down
36 changes: 16 additions & 20 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
Expand All @@ -9,11 +10,10 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

name: CodeQL
on:
push:
branches: [ main ]
branches: [main]
paths:
- cmd/**/*
- pkg/**/*
Expand All @@ -23,7 +23,7 @@ on:
- Dockerfile
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
paths:
- cmd/**/*
- pkg/**/*
Expand All @@ -32,39 +32,36 @@ on:
- dalfox.go
- Dockerfile
schedule:
- cron: '40 14 * * 2'

- cron: 40 14 * * 2
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
language: [go]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -76,6 +73,5 @@ jobs:
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
16 changes: 8 additions & 8 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
name: Contributors
on:
schedule:
- cron: '0 1 * * 0' # At 01:00 on Sunday.
- cron: 0 1 * * 0 # At 01:00 on Sunday.
push:
branches:
- main
branches: [main]
workflow_dispatch:
inputs:
logLevel:
description: 'manual run'
required: false
default: ''
inputs:
logLevel:
description: manual run
required: false
default: ''
jobs:
contributors:
runs-on: ubuntu-latest
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: CI Docker

on:
push:
branches: [ main ]
branches: [main]
paths:
- cmd/**/*
- pkg/**/*
Expand All @@ -11,22 +11,18 @@ on:
- dalfox.go
- Dockerfile
pull_request:
branches: [ main ]
branches: [main]
paths:
- cmd/**/*
- pkg/**/*
- lib/**/*
- go.mod
- dalfox.go
- Dockerfile

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag hahwul/dalfox:$(date +%s)
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag hahwul/dalfox:$(date +%s)
5 changes: 2 additions & 3 deletions .github/workflows/ghcr_publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
name: GHCR Publish

on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
Expand Down Expand Up @@ -72,4 +71,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
9 changes: 4 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
name: CI Go
on:
push:
branches: [ main ]
branches: [main]
paths:
- cmd/**/*
- pkg/**/*
Expand All @@ -10,7 +11,7 @@ on:
- dalfox.go
- Dockerfile
pull_request:
branches: [ main ]
branches: [main]
paths:
- cmd/**/*
- pkg/**/*
Expand All @@ -24,17 +25,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.23"]
go: ['1.23']
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get dependencies
run: |
go get -v -t -d ./...
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
---
name: GoReleaser

on:
push:
tags: [ 'no-trigger*.*.*' ]

tags: [no-trigger*.*.*]
permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v4
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
Expand Down
103 changes: 51 additions & 52 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,64 @@
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages
on:
name: Deploy Jekyll site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: [main]
paths:
- docs/**/*
push:
branches: [main]
paths:
- docs/**/*

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
concurrency:
group: pages
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
working-directory: docs # Needed if your Gemfile is not in the root directory
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
working-directory: docs # Needed if your Gemfile is not in the root directory
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
working-directory: docs
- name: Upload artifact
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
working-directory: docs
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
with:
path: docs/_site
uses: actions/upload-pages-artifact@v3
with:
path: docs/_site

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 6225d10

Please sign in to comment.