Skip to content

Commit 835b105

Browse files
Merge pull request #21 from gooddata/INFRA-3949-nexus
feat: add codeartifact/get-token
2 parents c734b4a + 5f38962 commit 835b105

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

codeartifact/get-token/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Code artifact get auth token
2+
3+
This action authenticates with aws code artifact and get the token.
4+
Then the token will be injected into environment variable `CODEARTIFACT_AUTH_TOKEN`.
5+
6+
Note: This action only works on `infra1-runners-arc`.
7+
8+
## Inputs
9+
10+
*None*
11+
12+
## Outputs
13+
14+
*None*
15+
16+
## Example usage
17+
18+
```
19+
name: Run gradle check
20+
21+
on:
22+
pull_request:
23+
24+
jobs:
25+
check:
26+
runs-on:
27+
group: infra1-runners-arc
28+
labels: runners-small
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- uses: gooddata/github-actions/codeartifact/get-token@master
33+
34+
- name: Setup Gradle
35+
uses: gradle/actions/setup-gradle@v3
36+
37+
- name: Check
38+
run: ./gradlew -I src/init.d/init.gradle.kts check --scan
39+
```

codeartifact/get-token/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: "Get code artifact authen token"
3+
description: "Get code artifact authen token"
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: CODEARTIFACT_AUTH_TOKEN
8+
shell: bash
9+
run: |
10+
CODEARTIFACT_AUTH_TOKEN=`
11+
aws codeartifact get-authorization-token \
12+
--domain infra1 \
13+
--domain-owner 020413372491 \
14+
--region us-east-1 --query authorizationToken --output text`
15+
echo "CODEARTIFACT_AUTH_TOKEN=$CODEARTIFACT_AUTH_TOKEN" >> $GITHUB_ENV
16+
echo "::add-mask::$CODEARTIFACT_AUTH_TOKEN"

0 commit comments

Comments
 (0)