An open API service indexing awesome lists of open source software.

https://github.com/flex-development/gpr-url-action

GitHub Package Registry URL utility for GitHub Actions
https://github.com/flex-development/gpr-url-action

actions github gpr url

Last synced: 5 months ago
JSON representation

GitHub Package Registry URL utility for GitHub Actions

Awesome Lists containing this project

README

          

# gpr-url

[![github release](https://img.shields.io/github/v/release/flex-development/gpr-url-action.svg?include_prereleases\&sort=semver)](https://github.com/flex-development/gpr-url-action/releases/latest)
[![test](https://github.com/flex-development/gpr-url-action/actions/workflows/test.yml/badge.svg)](https://github.com/flex-development/gpr-url-action/actions/workflows/test.yml)
[![module type: esm](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm)
[![license](https://img.shields.io/github/license/flex-development/gpr-url-action.svg)](LICENSE.md)
[![conventional commits](https://img.shields.io/badge/-conventional%20commits-fe5196?logo=conventional-commits\&logoColor=ffffff)](https://conventionalcommits.org)
[![yarn](https://img.shields.io/badge/-yarn-2c8ebb?style=flat\&logo=yarn\&logoColor=ffffff)](https://yarnpkg.com)

Get a GitHub Package Registry URL

## Contents

- [What is this?](#what-is-this)
- [Use](#use)
- [Inputs](#inputs)
- [`pkg`](#pkg)
- [`repo`](#repo)
- [`server`](#server)
- [Outputs](#outputs)
- [`url`](#url)
- [Contribute](#contribute)

## What is this?

This is a simple action for creating a GitHub Package Registry (GPR) URL.

## Use

```yaml
---
name: publish
on:
release:
types:
- published
jobs:
preflight:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.environment.outputs.url }}
steps:
- id: environment
name: Get environment url
uses: flex-development/gpr-url-action@1.0.0
gpr:
needs: preflight
permissions:
contents: read
id-token: write
packages: write
runs-on: ubuntu-latest
environment:
name: gpr
url: ${{ needs.preflight.outputs.environment }}
steps:
- id: checkout
name: Checkout ${{ github.ref_name }}
uses: actions/checkout@v5.0.0
with:
persist-credentials: false
ref: ${{ github.ref }}
- id: npmrc
name: Setup .npmrc file
uses: actions/setup-node@v5.0.0
with:
always-auth: true
node-version-file: .nvmrc
registry-url: https://npm.pkg.github.com
scope: ${{ github.repository_owner }}
- id: version
name: Get package version
uses: flex-development/manver-action@1.0.1
- id: dist-tag
name: Get dist tag
uses: flex-development/dist-tag-action@1.1.2
with:
target: ${{ steps.version.outputs.manifest }}
- id: publish
name: Publish package
env:
ARTIFACT: ${{ github.event.release.assets[0].browser_download_url }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --provenance ${{ steps.dist-tag.outputs.flag }} $ARTIFACT
```

## Inputs

### `pkg`

> **default**: `${{ github.event.repository.name }}`

The name of the package.

### `repo`

> **default**: `${{ github.repository }}`

The name of the repository, including the owner.

### `server`

> **default**: `${{ github.server_url }}`

The URL of the GitHub server.

## Outputs

### `url`

The package URL.

## Contribute

See [`CONTRIBUTING.md`](CONTRIBUTING.md).

This project has a [code of conduct](./CODE_OF_CONDUCT.md). By interacting with this repository, organization, or
community you agree to abide by its terms.