Used to authorize with AWS CodeArtifact in order to publish packages.
Requires aws-actions/configure-aws-credentials
to have been ran first with an appropriate role that can access CodeArtifact.
The AWS region.
The name of the domain that is in scope for the generated authorization token.
The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
The time, in seconds, that the generated authorization token is valid. Valid values are 0 and any number between 900 (15 minutes) and 43200 (12 hours). A value of 0 will set the expiration of the authorization token to the same expiration of the user's role's temporary credentials. Defaults to 0.
The action will export the following variables. These can then be used in conjunction with the package managers to publish artifacts.
Name | Description |
---|---|
NPM_TOKEN | The authentication token |
Name | Description |
---|---|
TWINE_USERNAME | The authentication username. Set as aws |
TWINE_PASSWORD | The authentication token |
Name | Description |
---|---|
MAVEN_USERNAME | The authentication username. Set as aws |
MAVEN_PASSWORD | The authentication token |
Name | Description |
---|---|
NUGET_AUTH_TOKEN | The authentication token |
# .github/workflows/aws-codeartifact-auth.yml
name: AWS CodeArtifact Auth
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
- name: AWS CodeArtifact Auth
uses: advancedcsg-open/actions-aws-codeartifact-auth
with:
region: ${{ secrets.AWS_REGION }}
domain: ${{ secrets.AWS_CODEARTIFACT_DOMAIN }}
domain-owner: ${{ secrets.AWS_CODEARTIFACT_DOMAIN_OWNER }}
- name: Publish npm
run: |
npm publish
actions-aws-codeartifact-auth is licensed under the MIT License. See the LICENSE file for more info.