From 443b05d8bc57001cabb85ba21289ea4436047d67 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Tue, 4 Feb 2025 23:46:54 +0900 Subject: [PATCH] fix: standardize YAML formatting across workflow files Signed-off-by: HAHWUL --- .github/workflows/codecov.yml | 17 ++--- .github/workflows/codeql-analysis.yml | 36 ++++----- .github/workflows/contributors.yml | 16 ++-- .github/workflows/docker-image.yml | 16 ++-- .github/workflows/ghcr_publish.yml | 5 +- .github/workflows/go.yml | 9 +-- .github/workflows/goreleaser.yaml | 15 ++-- .github/workflows/jekyll.yml | 103 +++++++++++++------------- 8 files changed, 100 insertions(+), 117 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 770c9817..e3df13cc 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,8 +1,8 @@ +--- name: Coverage - on: push: - branches: [ main ] + branches: [main] paths: - cmd/**/* - pkg/**/* @@ -12,7 +12,7 @@ on: - Dockerfile - codecov.yml pull_request: - branches: [ main ] + branches: [main] paths: - cmd/**/* - pkg/**/* @@ -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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c235bc92..ac342b4f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,3 +1,4 @@ +--- # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # @@ -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/**/* @@ -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/**/* @@ -32,30 +32,27 @@ 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. @@ -63,8 +60,8 @@ jobs: # 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 @@ -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 diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml index ad06001a..659dedd6 100644 --- a/.github/workflows/contributors.yml +++ b/.github/workflows/contributors.yml @@ -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 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 01757258..8801a2ca 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,8 +1,8 @@ +--- name: CI Docker - on: push: - branches: [ main ] + branches: [main] paths: - cmd/**/* - pkg/**/* @@ -11,7 +11,7 @@ on: - dalfox.go - Dockerfile pull_request: - branches: [ main ] + branches: [main] paths: - cmd/**/* - pkg/**/* @@ -19,14 +19,10 @@ on: - 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) diff --git a/.github/workflows/ghcr_publish.yml b/.github/workflows/ghcr_publish.yml index 58aecc0c..191266f5 100644 --- a/.github/workflows/ghcr_publish.yml +++ b/.github/workflows/ghcr_publish.yml @@ -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 @@ -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 \ No newline at end of file + cache-to: type=gha,mode=max diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 83c0e020..1fe40896 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,7 +1,8 @@ +--- name: CI Go on: push: - branches: [ main ] + branches: [main] paths: - cmd/**/* - pkg/**/* @@ -10,7 +11,7 @@ on: - dalfox.go - Dockerfile pull_request: - branches: [ main ] + branches: [main] paths: - cmd/**/* - pkg/**/* @@ -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 ./... diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index ef7f800d..aed6171a 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -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 diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index bb770cec..43d2bfbc 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -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 \ No newline at end of file + 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