-
Notifications
You must be signed in to change notification settings - Fork 230
github-action: enable provenance #2014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.github/workflows/packages.yml
Outdated
- name: Build packages | ||
run: ./dev-utils/make-packages.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should help with reusing the script somewhere else and do some post-build steps
needs: | ||
- build-distribution | ||
runs-on: ubuntu-latest | ||
permissions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the build attestation
if [ "${{ startsWith(github.ref, 'refs/tags') }}" == "false" ] ; then | ||
# for testing purposes | ||
echo "tag=test" >> "${GITHUB_OUTPUT}" | ||
echo "latest=test-latest" >> "${GITHUB_OUTPUT}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To help with creating docker images on the fly and use them even for testing the release in a feature branch or main.
if: startsWith(github.ref, 'refs/tags') | ||
run: |- | ||
docker push --all-tags ${{ env.DOCKER_IMAGE_NAME }} | ||
- name: Build and push image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required for the attestation
secret/observability-team/ci/service-account/apm-agent-python access_key_id | AWS_ACCESS_KEY_ID ; | ||
secret/observability-team/ci/service-account/apm-agent-python secret_access_key | AWS_SECRET_ACCESS_KEY | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Faster builds
.github/workflows/release.yml
Outdated
- "v*.*.*" | ||
branches: | ||
- main | ||
- feature/sbom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrequired
- name: Attest image | ||
uses: github-early-access/generate-build-provenance@main | ||
with: | ||
subject-name: "${{ env.DOCKER_IMAGE_NAME }}:${{ steps.setup-docker.outputs.tag }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... Do NOT include a tag as part of the image name -- the specific image being attested is identified by the supplied digest. ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!! Fixing it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, it works as is:
https://github.com/elastic/apm-agent-python/attestations/739913
What does this pull request do?
Use https://github.com/github-early-access/generate-build-provenance to create build attestations for binaries and docker images
https://github.com/elastic/apm-agent-python/attestations is the one with the different executions.