diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..43cf27e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2026 Risk.Ident GmbH +# +# SPDX-License-Identifier: CC0-1.0 + +# See GitHub's documentation for more information on this file: +# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + cooldown: + default-days: 7 diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000..fdcd7d3 --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: 2023 Risk.Ident GmbH +# +# SPDX-License-Identifier: CC0-1.0 + +name: github-actions +on: + push: + branches: + - "main" + pull_request: + +permissions: {} + +jobs: + zizmor: + name: Run zizmor 🌈 + runs-on: ubuntu-latest + permissions: + security-events: write + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run zizmor 🌈 + uses: zizmorcore/zizmor-action@0dce2577a4760a2749d8cfb7a84b7d5585ebcb7d # v0.5.0 diff --git a/.github/workflows/go-cross.yml b/.github/workflows/go-cross.yml index ed37db1..a06bb1a 100644 --- a/.github/workflows/go-cross.yml +++ b/.github/workflows/go-cross.yml @@ -12,6 +12,8 @@ jobs: runs-on: ${{ matrix.os }} env: CGO_ENABLED: 0 + permissions: + contents: read strategy: matrix: @@ -19,19 +21,18 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] steps: - # https://github.com/marketplace/actions/setup-go-environment - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 + uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: go-version: ${{ matrix.go-version }} - # https://github.com/marketplace/actions/checkout - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - # https://github.com/marketplace/actions/cache - name: Cache Go modules - uses: actions/cache@v3 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: # In order: # * Module download cache diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7617390..3e2f1fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,25 +19,24 @@ jobs: defaults: run: working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} + permissions: + contents: read steps: - - # https://github.com/marketplace/actions/setup-go-environment - - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v5 + - name: Install Go + uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: go-version: ${{ env.GO_VERSION }} - # https://github.com/marketplace/actions/checkout - - name: Check out code - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: + persist-credentials: false path: go/src/github.com/${{ github.repository }} fetch-depth: 0 - # https://github.com/marketplace/actions/cache - name: Cache Go modules - uses: actions/cache@v4 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: ${{ github.workspace }}/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -45,14 +44,16 @@ jobs: ${{ runner.os }}-go- # https://golangci-lint.run/usage/install#other-ci - - name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }} - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION} + - name: Install golangci-lint + run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin "${GOLANGCI_LINT_VERSION}" - - name: Install Yaegi ${{ env.YAEGI_VERSION }} - run: curl -sfL https://raw.githubusercontent.com/traefik/yaegi/master/install.sh | bash -s -- -b $(go env GOPATH)/bin ${YAEGI_VERSION} + - name: Install Yaegi + run: curl -sfL https://raw.githubusercontent.com/traefik/yaegi/master/install.sh | bash -s -- -b $(go env GOPATH)/bin "${YAEGI_VERSION}" - name: Setup GOPATH - run: go env -w GOPATH=${{ github.workspace }}/go + env: + GOPATH: ${{ github.workspace }}/go + run: go env -w GOPATH="${GOPATH}" - name: Check and get dependencies run: |