Skip to content

Commit ade1d0e

Browse files
authored
chore: migrate gosec container image references to GHCR (#1567)
1 parent 88835e8 commit ade1d0e

6 files changed

Lines changed: 12 additions & 15 deletions

File tree

.github/prompts/update-gosec-action-version.prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Update Gosec Action Version
33
mode: agent
4-
description: Update action.yml to use a provided gosec version and open a pull request using the reusable gosec skill.
4+
description: Update action.yml to use a provided gosec GHCR image version and open a pull request using the reusable gosec skill.
55
---
66

77
Use the skill Update Gosec Action Version from .github/skills/gosec-update-action-version/SKILL.md.

.github/skills/gosec-update-action-version/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Update Gosec Action Version
3-
description: Update the gosec Docker image version in action.yml using a provided gosec version.
3+
description: Update the gosec GHCR image version in action.yml using a provided gosec version.
44
---
55

66
# Update gosec version in GitHub Action metadata
@@ -15,16 +15,16 @@ Use this skill when you want to update the gosec version used by this repository
1515
## Execution workflow
1616

1717
1. Read `action.yml`.
18-
2. Locate `runs.image` with format `docker://securego/gosec:<version>`.
18+
2. Locate `runs.image` with format `docker://ghcr.io/securego/gosec:<version>`.
1919
3. Replace only the version segment after the colon with the provided gosec version.
2020
4. Do not change unrelated fields or formatting in `action.yml`.
21-
5. Validate that the resulting image value is exactly `docker://securego/gosec:<provided_version>`.
21+
5. Validate that the resulting image value is exactly `docker://ghcr.io/securego/gosec:<provided_version>`.
2222
6. Create a branch named `chore/update-action-gosec-<provided_version>`.
2323
7. Commit the change with message `chore(action): bump gosec to <provided_version>`.
2424
8. Push the branch to origin.
2525
9. Open a pull request to `master` with:
2626
- Title: `chore(action): bump gosec to <provided_version>`
27-
- Body: concise summary that this updates `action.yml` Docker image version.
27+
- Body: concise summary that this updates `action.yml` GHCR image version.
2828

2929
## Output requirements
3030

.github/workflows/release.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ jobs:
3434
uses: docker/setup-qemu-action@v3
3535
- name: Set up Docker Buildx
3636
uses: docker/setup-buildx-action@v3
37-
- name: Login to DockerHub
38-
uses: docker/login-action@v3
39-
with:
40-
username: ${{secrets.DOCKER_USERNAME}}
41-
password: ${{secrets.DOCKER_PASSWORD}}
4237
- name: Login to GitHub Container Registry
4338
uses: docker/login-action@v3
4439
with:
@@ -55,7 +50,6 @@ jobs:
5550
id: meta
5651
with:
5752
images: |
58-
securego/gosec
5953
ghcr.io/securego/gosec
6054
flavor: |
6155
latest=true

DEVELOPMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ The release workflow builds binaries and Docker images, then signs artifacts.
414414
Verify signatures:
415415

416416
```bash
417-
cosign verify --key cosign.pub securego/gosec:<TAG>
417+
cosign verify --key cosign.pub ghcr.io/securego/gosec:<TAG>
418418
cosign verify-blob --key cosign.pub --signature gosec_<VERSION>_darwin_amd64.tar.gz.sig gosec_<VERSION>_darwin_amd64.tar.gz
419419
```
420420

@@ -429,7 +429,7 @@ make image
429429
Run against a local project:
430430

431431
```bash
432-
docker run --rm -it -w /<PROJECT>/ -v <YOUR_PROJECT_PATH>/<PROJECT>:/<PROJECT> securego/gosec /<PROJECT>/...
432+
docker run --rm -it -w /<PROJECT>/ -v <YOUR_PROJECT_PATH>/<PROJECT>:/<PROJECT> ghcr.io/securego/gosec:latest /<PROJECT>/...
433433
```
434434

435435
Set `-w` so module dependencies resolve from the mounted project root.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
Inspects source code for security problems by scanning the Go AST and SSA code representation.
55

6+
> ⚠️ Container image migration notice: `gosec` images have been migrated from Docker Hub to `ghcr.io/securego/gosec`.
7+
> Starting with the next release, Docker Hub images will no longer be published.
8+
69
<img src="https://securego.io/img/gosec.png" width="320">
710

811
## Quick links
@@ -35,7 +38,7 @@ You may obtain a copy of the License [here](http://www.apache.org/licenses/LICEN
3538
[![GoDoc](https://pkg.go.dev/badge/github.com/securego/gosec/v2)](https://pkg.go.dev/github.com/securego/gosec/v2)
3639
[![Docs](https://readthedocs.org/projects/docs/badge/?version=latest)](https://securego.io/)
3740
[![Downloads](https://img.shields.io/github/downloads/securego/gosec/total.svg)](https://github.com/securego/gosec/releases)
38-
[![Docker Pulls](https://img.shields.io/docker/pulls/securego/gosec.svg)](https://hub.docker.com/r/securego/gosec/tags)
41+
[![GHCR](https://img.shields.io/badge/ghcr.io-securego%2Fgosec-blue)](https://github.com/orgs/securego/packages/container/package/gosec)
3942
[![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](http://securego.slack.com)
4043
[![go-recipes](https://raw.githubusercontent.com/nikolaydubina/go-recipes/main/badge.svg?raw=true)](https://github.com/nikolaydubina/go-recipes)
4144

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010

1111
runs:
1212
using: "docker"
13-
image: "docker://securego/gosec:2.24.0"
13+
image: "docker://ghcr.io/securego/gosec:2.24.6"
1414
args:
1515
- ${{ inputs.args }}
1616

0 commit comments

Comments
 (0)