diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 377d6712..5aac9346 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,30 +3,30 @@ name: Go on: push: branches: - - master + - master pull_request: branches: - - master + - master jobs: build: - if: ${{ !startsWith(github.event.head_commit.message, 'docs:') }} + if: ${{ !startsWith(coalesce(github.event.pull_request.title, github.event.head_commit.message, ''), 'docs:') }} name: Build runs-on: ubuntu-latest steps: - - name: Set up Go 1.x - uses: actions/setup-go@v6 - with: - go-version: '^1.26.0' - check-latest: true - id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - - name: Style - run: make style - - name: Vet - run: make vet - - name: Test - run: make test - - name: Build - run: make build + - name: Set up Go 1.x + uses: actions/setup-go@v6 + with: + go-version: "^1.26.0" + check-latest: true + id: go + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + - name: Style + run: make style + - name: Vet + run: make vet + - name: Test + run: make test + - name: Build + run: make build diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a98e2cf2..a661e8be 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -7,59 +7,40 @@ on: # The branches below must be a subset of the branches above branches: [master] schedule: - - cron: '0 23 * * 5' + - cron: "0 23 * * 5" jobs: analyze: - if: | - ${{ !startsWith(github.event.head_commit.message, 'docs:') }} || - ${{ !startsWith(github.event.head_commit.message, 'build:') }} + if: | + ${{ !(startsWith(github.event.head_commit.message, 'docs:') || startsWith(github.event.head_commit.message, 'build:')) }} name: Analyze runs-on: ubuntu-latest strategy: fail-fast: false matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['go'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + language: ["go"] steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: '^1.26.0' - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - # 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@v3 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Checkout repository + uses: actions/checkout@v4 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: "^1.26.0" + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 9538d1fa..ed3bff80 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -10,7 +10,7 @@ on: - main - master schedule: - - cron: '33 2 * * *' + - cron: "33 2 * * *" permissions: contents: read diff --git a/.github/workflows/helm-workflow.yaml b/.github/workflows/helm-workflow.yaml index 219baed4..748fe8d2 100644 --- a/.github/workflows/helm-workflow.yaml +++ b/.github/workflows/helm-workflow.yaml @@ -34,7 +34,7 @@ jobs: # -- the commit hash set in the previous step from a # -- currently released chart. If it doesn't exists, then # -- I assume that chart is not released and compare to the - # -- previous commit + # -- previous commit # -- # -- Also, I'm setting the RepoURL here. Since we plan to support # -- the official chart in this git repository, the helm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba8e94df..1904819b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: tags: - - '*.*.*' + - "*.*.*" jobs: build: @@ -13,41 +13,41 @@ jobs: env: VERSION: ${{ github.ref_name }} steps: - - name: Set up Go 1.x - uses: actions/setup-go@v6 - with: - go-version: '^1.26.0' - check-latest: true - - name: Check out code into the Go module directory - uses: actions/checkout@v4 + - name: Set up Go 1.x + uses: actions/setup-go@v6 + with: + go-version: "^1.26.0" + check-latest: true + - name: Check out code into the Go module directory + uses: actions/checkout@v4 - - name: Promu - Crossbuild - run: make crossbuild + - name: Promu - Crossbuild + run: make crossbuild - - name: Promu - Prepare packages - run: make crossbuild-tarballs + - name: Promu - Prepare packages + run: make crossbuild-tarballs - - name: Create deb package - uses: burningalchemist/action-gh-nfpm@v1 - with: - packager: deb - config: packaging/conf/nfpm.yaml - target: .tarballs/ - - name: Create rpm package - uses: burningalchemist/action-gh-nfpm@v1 - with: - packager: rpm - config: packaging/conf/nfpm.yaml - target: .tarballs/ + - name: Create deb package + uses: burningalchemist/action-gh-nfpm@v1 + with: + packager: deb + config: packaging/conf/nfpm.yaml + target: .tarballs/ + - name: Create rpm package + uses: burningalchemist/action-gh-nfpm@v1 + with: + packager: rpm + config: packaging/conf/nfpm.yaml + target: .tarballs/ - - name: Calculate checksums - run: make crossbuild-checksum + - name: Calculate checksums + run: make crossbuild-checksum - - name: Upload artifacts - uses: softprops/action-gh-release@v2.2.2 - with: - files: | - .tarballs/* + - name: Upload artifacts + uses: softprops/action-gh-release@v2.2.2 + with: + files: | + .tarballs/* docker: name: Push Docker image to Docker Hub runs-on: ubuntu-latest