Skip to content

Commit 545b237

Browse files
authored
ci: update GitHub Actions workflows and remove CodeQL configuration (#496)
This commit updates various GitHub Actions workflows by standardizing action versions and enhancing security policies. Key changes include: - Removed the CodeQL workflow. - Updated action versions for `checkout`, `setup-go`, `harden-runner`, and others for consistency and security. - Added environment variables and permissions to several workflows to improve configuration clarity. - Adjusted egress policies in the `harden-runner` step to enhance security measures.
1 parent c9a583d commit 545b237

6 files changed

Lines changed: 49 additions & 80 deletions

File tree

.github/workflows/base-docker.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
php-version: [ "8.4", "8.3", "8.2", "8.1"]
19+
php-version: ["8.4", "8.3", "8.2", "8.1"]
2020
steps:
2121
- name: Harden Runner
22-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481
22+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # ratchet:step-security/harden-runner@v2.11.0
2323
with:
2424
egress-policy: audit
2525

2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
2828

2929
- name: Set up QEMU
30-
uses: docker/setup-qemu-action@v3
30+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # ratchet:docker/setup-qemu-action@v3
3131

3232
- name: Login into Github Docker Registry
3333
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
3434

3535
- name: Set up Docker Buildx
36-
uses: docker/setup-buildx-action@v3
36+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # ratchet:docker/setup-buildx-action@v3
3737

3838
- name: Build and push
39-
uses: docker/build-push-action@v6
39+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # ratchet:docker/build-push-action@v6
4040
with:
4141
context: .
4242
push: true

.github/workflows/codeql.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/go_test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ name: Tests
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
tags-ignore:
77
- "*"
88
pull_request:
9-
branches: [ "main" ]
9+
branches: ["main"]
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
GOTOOLCHAIN: local
1016

1117
jobs:
1218
build:
@@ -24,10 +30,10 @@ jobs:
2430
runs-on: ${{ matrix.os }}
2531
steps:
2632
- name: Checkout Repository
27-
uses: actions/checkout@v4
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
2834

2935
- name: Set up Go
30-
uses: actions/setup-go@v5
36+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # ratchet:actions/setup-go@v5
3137
with:
3238
go-version: '1.24'
3339
check-latest: true

.github/workflows/lint.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,37 @@ on:
1919
permissions:
2020
contents: read
2121

22+
env:
23+
GOTOOLCHAIN: local
24+
2225
jobs:
2326
golangci:
2427
name: lint
2528
runs-on: ubuntu-latest
2629
steps:
2730
- name: Harden Runner
28-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481
31+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # ratchet:step-security/harden-runner@v2.11.0
2932
with:
30-
egress-policy: audit
33+
egress-policy: block
34+
disable-sudo: true
35+
allowed-endpoints: >
36+
api.github.com:443
37+
github.com:443
38+
golangci-lint.run:443
39+
objects.githubusercontent.com:443
40+
proxy.golang.org:443
3141
32-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
3343

3444
- name: Set up Go
35-
uses: actions/setup-go@v5
45+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # ratchet:actions/setup-go@v5
3646
with:
3747
go-version: '1.24'
3848
check-latest: true
3949
cache: true
4050

4151
- name: golangci-lint
42-
uses: golangci/golangci-lint-action@v6
52+
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # ratchet:golangci/golangci-lint-action@v6
4353
with:
4454
version: latest
4555
args: --timeout 4m

.github/workflows/release.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,58 @@ permissions:
1010
id-token: write
1111
packages: write
1212

13+
env:
14+
GOTOOLCHAIN: local
15+
1316
jobs:
1417
release:
1518
runs-on: ubuntu-latest
1619
steps:
1720
- name: Harden Runner
18-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481
21+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # ratchet:step-security/harden-runner@v2.11.0
1922
with:
2023
egress-policy: audit
2124

2225
- name: Checkout
23-
uses: actions/checkout@v4
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
2427
with:
2528
fetch-depth: 0
2629

2730
- name: Set up Go
28-
uses: actions/setup-go@v5
31+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # ratchet:actions/setup-go@v5
2932
with:
3033
go-version: '1.24'
3134
cache: true
3235
check-latest: true
3336

3437
- name: Install Nix
35-
uses: DeterminateSystems/nix-installer-action@main
38+
uses: DeterminateSystems/nix-installer-action@a48face58194521af687ce7df4c802b1b558e743 # ratchet:DeterminateSystems/nix-installer-action@main
3639

3740
- name: Set up Docker Buildx
38-
uses: docker/setup-buildx-action@v3
41+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # ratchet:docker/setup-buildx-action@v3
3942

4043
- name: Install Cosign
41-
uses: sigstore/cosign-installer@v3
44+
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # ratchet:sigstore/cosign-installer@v3
4245

4346
- name: Install Syft
44-
uses: anchore/sbom-action/download-syft@v0.18.0
47+
uses: anchore/sbom-action/download-syft@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # ratchet:anchore/sbom-action/download-syft@v0.18.0
4548

4649
- name: Gather Frosh Homebrew Token
47-
uses: octo-sts/action@v1.0.0
50+
uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f # ratchet:octo-sts/action@v1.0.0
4851
id: sts-homebrew
4952
with:
5053
scope: FriendsOfShopware/homebrew-tap
5154
identity: release
5255

5356
- name: Gather Homebrew Token
54-
uses: octo-sts/action@v1.0.0
57+
uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f # ratchet:octo-sts/action@v1.0.0
5558
id: sts-shopware
5659
with:
5760
scope: shopware/homebrew-tap
5861
identity: swcli
5962

6063
- name: Gather NUR Token
61-
uses: octo-sts/action@v1.0.0
64+
uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f # ratchet:octo-sts/action@v1.0.0
6265
id: sts-nur
6366
with:
6467
scope: FriendsOfShopware/nur-packages
@@ -68,7 +71,7 @@ jobs:
6871
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
6972

7073
- name: Run GoReleaser
71-
uses: goreleaser/goreleaser-action@v6
74+
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # ratchet:goreleaser/goreleaser-action@v6
7275
with:
7376
version: '~> v2'
7477
args: release --clean

.github/workflows/smoke-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ jobs:
1515
egress-policy: audit
1616

1717
- name: Checkout Repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
1919

2020
- name: Set up Go
21-
uses: actions/setup-go@v5
21+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # ratchet:actions/setup-go@v5
2222
with:
2323
go-version: '1.24'
2424
cache: true
2525
check-latest: true
2626

2727
- name: Setup PHP
28-
uses: shivammathur/setup-php@v2
28+
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # ratchet:shivammathur/setup-php@v2
2929
with:
3030
php-version: '8.2'
3131

3232
- name: Compile shopware-cli
3333
run: go build
3434

3535
- name: Checkout Plugin
36-
uses: actions/checkout@v4
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
3737
with:
3838
repository: 'FriendsOfShopware/FroshTools'
3939
ref: '75e2013752fd4db7535e4b72b3e3e8d57e531002'

0 commit comments

Comments
 (0)