Skip to content

Commit ae49a75

Browse files
authored
Use keyless authentication for the release (#495)
* Use keyless authentication for the releasee * Pass AWS_SESSION_TOKEN to goreleaser publisher
1 parent c015eaf commit ae49a75

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ permissions:
1919
jobs:
2020
build:
2121
runs-on: ubuntu-latest
22-
env:
23-
# TODO: use keyless
24-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
25-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2622
steps:
2723
- uses: actions/checkout@v4
2824
with:
2925
fetch-depth: 0
3026

27+
- uses: elastic/oblt-actions/aws/[email protected]
28+
with:
29+
aws-account-id: "267093732750"
30+
3131
- name: Validate GitHub release is not available yet
3232
run: |
3333
if gh release view "${{ github.ref_name }} > /dev/null ; then

.goreleaser.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ publishers:
8888
env:
8989
- AWS_ACCESS_KEY_ID={{ .Env.AWS_ACCESS_KEY_ID }}
9090
- AWS_SECRET_ACCESS_KEY={{ .Env.AWS_SECRET_ACCESS_KEY }}
91+
- AWS_SESSION_TOKEN={{ .Env.AWS_SESSION_TOKEN }}
9192
- ELASTIC_LAYER_NAME=elastic-apm-extension-ver-{{ replace (trimprefix .Tag "v") "." "-" }}
9293
- VERSION={{ .Tag }}
9394
- ARCHITECTURE={{ if eq .Arch "amd64" }}x86_64{{ else }}{{ .Arch }}{{ end }}
@@ -101,4 +102,4 @@ release:
101102
# creates SBOMs of all archives and the source tarball using syft
102103
# https://goreleaser.com/customization/sbom
103104
sboms:
104-
- artifacts: archive
105+
- artifacts: archive

0 commit comments

Comments
 (0)