Skip to content

Commit 16e289b

Browse files
authored
fix: make build reproducible by using commit timestamp (#102)
1 parent 2aac4ef commit 16e289b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ on:
1212
permissions: {}
1313

1414
# TODO: explore more options: https://docs.docker.com/build/ci/github-actions/
15-
# TODO: explore more options: https://github.com/docker/build-push-action
1615
# TODO: Experiment GitHub deployments
1716
# TODO: do we want to test multi-arch build?
18-
# TODO: reproductible builds? https://docs.docker.com/build/ci/github-actions/reproducible-builds/
1917
# TODO: SonarQube integration at both CI and Docker Scout levels?
2018
# TODO: Migrate from Trivy to Docker Scout
2119
jobs:

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,14 @@ jobs:
101101
- name: Set up Docker Buildx
102102
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
103103

104+
- name: Retrieve Git commit timestamp
105+
run: echo "GIT_COMMIT_TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
106+
104107
- name: Release
105108
env:
106109
GITHUB_TOKEN: ${{ github.token }}
107110
ROOT_PROJECT_DIR: ${{ github.workspace }}
108111
REVISION: ${{ github.sha }}
112+
SOURCE_DATE_EPOCH: ${{ env.GIT_COMMIT_TIMESTAMP }} # Reproducible build: https://reproducible-builds.org/docs/source-date-epoch/
109113
working-directory: .github/semantic-release/
110114
run: npx --no-install semantic-release

0 commit comments

Comments
 (0)