Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions codeartifact/get-token/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Code artifact get auth token

This action authenticates with aws code artifact and get the token.
Then the token will be injected into environment variable `CODEARTIFACT_AUTH_TOKEN`.

Note: This action only works on `infra1-runners-arc`.

## Inputs

*None*

## Outputs

*None*

## Example usage

```
name: Run gradle check

on:
pull_request:

jobs:
check:
runs-on:
group: infra1-runners-arc
labels: runners-small
steps:
- uses: actions/checkout@v3

- uses: gooddata/github-actions/codeartifact/get-token@master

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Check
run: ./gradlew -I src/init.d/init.gradle.kts check --scan
```
16 changes: 16 additions & 0 deletions codeartifact/get-token/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: "Get code artifact authen token"
description: "Get code artifact authen token"
runs:
using: "composite"
steps:
- name: CODEARTIFACT_AUTH_TOKEN
shell: bash
run: |
CODEARTIFACT_AUTH_TOKEN=`
aws codeartifact get-authorization-token \
--domain infra1 \
--domain-owner 020413372491 \
--region us-east-1 --query authorizationToken --output text`
echo "CODEARTIFACT_AUTH_TOKEN=$CODEARTIFACT_AUTH_TOKEN" >> $GITHUB_ENV
echo "::add-mask::$CODEARTIFACT_AUTH_TOKEN"
Loading