This action drops an existing staged repository, generally to discard previously uploaded artifacts after a job failure.
Here is an example of how to use this action in your workflows.
on: [push]
jobs:
create_staging_repository:
#...
build:
needs: create_staging_repository
# ...
discard:
runs-on: ubuntu-latest
needs: [create_staging_repository, build]
if: ${{ always() && needs.build.result != 'success' }}
steps:
- name: Discard
# replace '@main' with the latest commit sha, see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
uses: nexus-actions/drop-nexus-staging-repo@main
with:
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_repository_id: ${{ needs.create_staging_repository.outputs.repository-id }}
The different arguments are:
username
: Your Sonatype username, same the Sonatype Jira onepassword
: Your Sonatype password, same the Sonatype Jira onestaging_repository_id
: The ID of the staged repository to drop.base_url
: The url of your nexus repository, default to OSSRH (https://oss.sonatype.org/service/local/)
See the nexus-actions-demo repo for more details and use cases.
- Martin Bonnin from Apollo GraphQL
- Romain Boisselle from Kodein Koders