Skip to content

Commit 6a0a6d0

Browse files
authored
feat: ensure contents of container image changes (#46)
I got confused when the release tagging was being applied to the same release package (container image). This was because the container image was not changing. With this change, we put the contents of the repo into the container image, ensuring there is change and a new image and digest is created. This will also cause new attestation to be created. - [x] remove .github folder from .dockerignore to ensure the folder is put into the container image - [x] update README explaining what the image contents are and why Signed-off-by: jmeridth <[email protected]>
1 parent f5b5282 commit 6a0a6d0

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

.dockerignore

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
# Common
2-
*.md
2+
3+
_.md
34
docker-compose.yml
4-
Dockerfile*
5-
.env*
5+
Dockerfile_
6+
.env\*
67
Makefile
78

89
# Logs
10+
911
logs
10-
*.log
12+
\*.log
1113

1214
# IDE's
15+
1316
.vscode/
1417
.idea/
1518

1619
# Dependency directories
20+
1721
node_modules/
1822
.venv/
1923

2024
## Cache directories
25+
2126
.parcel-cache
2227

2328
# git
29+
2430
.git
2531
.gitattributes
2632
.gitignore
27-
.github/

.github/workflows/test-auto-labeler.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ permissions:
99
jobs:
1010
auto_labeler:
1111
permissions:
12+
contents: read
1213
pull-requests: write
1314
uses: ./.github/workflows/auto-labeler.yaml
1415
with:

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
FROM alpine
2-
CMD ["echo", "Hello World!!"]
2+
3+
WORKDIR /app
4+
5+
# copy all files from repo to ensure all changes are included
6+
# which will ensure a new image digest is generated
7+
COPY . .
8+
9+
CMD ["cat", "README.md"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ This is a placeholder repo for multiple GitHub Actions we use in open source pro
2323
> - [labeler.yml](.github/labeler.yml)
2424
> - [release-drafter.yaml](.github/release-drafter.yaml)
2525
26-
> [!WARNING]
27-
> The container image generated in this repo is a placeholder, it contains no content. It uses [alpine:latest and says "Hello World"](https://github.com/github/ospo-reusable-workflows/blob/main/Dockerfile). The image creation option is for GitHub Actions who need it because their Action is not written in JavaScript/Typescript and they want to track downloads/usage.
26+
> [!NOTE]
27+
> The container image generated in this repo is a placeholder, it contains the files of this repository to ensure it shows "change" and a new container image digest is generated. This allows us to see tagging of the new container image is working and newly generated attestation is related to a new SHA/digest in the [packages view](https://github.com/github/ospo-reusable-workflows/pkgs/container/ospo-reusable-workflows).

docs/auto-labeler.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
```yaml
66
- uses: github/ospo-reusable-workflows/.github/workflows/auto-labeler.yml@main
77
permissions:
8+
contents: read
89
pull-requests: write
910
with:
1011
# The name of the configuration file to use, default is release-drafter.yml

0 commit comments

Comments
 (0)