https://github.com/atlassian-labs/artifact-publish-token
Custom Action to retrieve temporary tokens to publish artifacts
https://github.com/atlassian-labs/artifact-publish-token
Last synced: about 2 months ago
JSON representation
Custom Action to retrieve temporary tokens to publish artifacts
- Host: GitHub
- URL: https://github.com/atlassian-labs/artifact-publish-token
- Owner: atlassian-labs
- License: apache-2.0
- Created: 2022-03-28T01:21:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T03:32:40.000Z (7 months ago)
- Last Synced: 2025-04-21T23:39:23.610Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.21 MB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Artifact Publish Token Action
This action generates a temporary authentication token to publish artifacts to `packages.atlassian.com`
## Inputs
### `output-modes`
The preferred output modes of the publish token. It supports the following values:
* **maven**: Creates the maven settings file (~/.m2/settings.xml) with the credentials for the repository `maven-atlassian-com`
* **gradle**: Creates the gradle global properties file (~/.gradle/gradle.properties) including the properties: `ARTIFACTORY_USERNAME` and `ARTIFACTORY_API_KEY` populated with the temporary credentials
* **environment**: Exports credentials as environment variables: `ARTIFACTORY_USERNAME` and `ARTIFACTORY_API_KEY`
* **output**: Default option if not provided, populates the credentials as step output variables: `artifactUsername` and `artifactApiToken`
## Outputs
### `artifactUsername`
The temporary publish username
### `artifactApiToken`
The temporary publish token## Example Usage
```yaml
jobs:
# ...
build:
# minimal permissions
permissions:
contents: read
id-token: write
steps:
# ...
- name: Get Artifact Publish Token
id: publish-token
uses: atlassian-labs/[email protected]
with:
output-modes: maven
# ... publish your artifact
- name: Publish artifact
run: mvn release:perform
```* The permissions are required in order to access GitHub OIDC Provider.
## Development
### Testing
`npm run test` will run the units tests
### Release Changes
Commit all your changes and run the following command to bump the version number and publish a new version
```shell
npm run release
```