mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-03-19 21:02:45 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d671a9dc0 | |||
| 253e14a37b |
18
.github/workflows/security.yml
vendored
18
.github/workflows/security.yml
vendored
@@ -115,10 +115,24 @@ jobs:
|
|||||||
|
|
||||||
- name: Build the bin
|
- name: Build the bin
|
||||||
shell: bash
|
shell: bash
|
||||||
run: make build
|
run: |
|
||||||
|
# Auto-detect platform (matching GoReleaser's structure)
|
||||||
|
PLATFORM="$(go env GOOS)/$(go env GOARCH)"
|
||||||
|
|
||||||
|
# Create platform-specific directory structure
|
||||||
|
mkdir -p "$PLATFORM"
|
||||||
|
|
||||||
|
# Build binary into the platform directory
|
||||||
|
go build -o "$PLATFORM/gh-action-readme" .
|
||||||
|
|
||||||
|
# Verify binary was created
|
||||||
|
ls -lh "$PLATFORM/gh-action-readme"
|
||||||
|
|
||||||
|
# Export platform for Docker build step
|
||||||
|
echo "TARGETPLATFORM=$PLATFORM" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: docker build -t gh-action-readme:test .
|
run: docker build --build-arg TARGETPLATFORM=${{ env.TARGETPLATFORM }} -t gh-action-readme:test .
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner on Docker image
|
- name: Run Trivy vulnerability scanner on Docker image
|
||||||
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # 0.33.1
|
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # 0.33.1
|
||||||
|
|||||||
@@ -56,9 +56,11 @@ archives:
|
|||||||
- README.md
|
- README.md
|
||||||
- LICENSE*
|
- LICENSE*
|
||||||
- CHANGELOG.md
|
- CHANGELOG.md
|
||||||
- docs/**/*
|
- docs/*.md
|
||||||
- templates/**/*
|
- templates/*.tmpl
|
||||||
- schemas/**/*
|
- templates/themes/**/*.tmpl
|
||||||
|
- templates/themes/**/*.adoc
|
||||||
|
- schemas/*.json
|
||||||
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
@@ -196,6 +198,9 @@ dockers_v2:
|
|||||||
platforms:
|
platforms:
|
||||||
- linux/amd64
|
- linux/amd64
|
||||||
- linux/arm64
|
- linux/arm64
|
||||||
|
extra_files:
|
||||||
|
- templates
|
||||||
|
- schemas
|
||||||
labels:
|
labels:
|
||||||
org.opencontainers.image.created: "{{.Date}}"
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
org.opencontainers.image.title: "{{.ProjectName}}"
|
org.opencontainers.image.title: "{{.ProjectName}}"
|
||||||
|
|||||||
10
Dockerfile
10
Dockerfile
@@ -1,8 +1,14 @@
|
|||||||
# Dockerfile for gh-action-readme
|
# Dockerfile for gh-action-readme
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
# Copy the binary from the build context
|
# Multi-platform build support
|
||||||
COPY gh-action-readme /usr/local/bin/gh-action-readme
|
# See: https://goreleaser.com/customization/dockers_v2/
|
||||||
|
# GoReleaser organizes binaries in platform subdirectories (linux/amd64/, linux/arm64/)
|
||||||
|
# TARGETPLATFORM arg resolves to the correct platform directory
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
|
# Copy the binary from the build context (platform-specific)
|
||||||
|
COPY $TARGETPLATFORM/gh-action-readme /usr/local/bin/gh-action-readme
|
||||||
|
|
||||||
# Copy templates and schemas
|
# Copy templates and schemas
|
||||||
COPY templates /usr/local/share/gh-action-readme/templates
|
COPY templates /usr/local/share/gh-action-readme/templates
|
||||||
|
|||||||
Reference in New Issue
Block a user