https://github.com/flex-development/ghr-url-action
Create a URL for a GitHub registry
https://github.com/flex-development/ghr-url-action
actions container deploy deployment environment ghcr github gpr url
Last synced: 4 months ago
JSON representation
Create a URL for a GitHub registry
- Host: GitHub
- URL: https://github.com/flex-development/ghr-url-action
- Owner: flex-development
- License: bsd-3-clause
- Created: 2025-09-17T23:58:20.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-10-01T01:37:32.000Z (4 months ago)
- Last Synced: 2025-10-01T03:33:22.639Z (4 months ago)
- Topics: actions, container, deploy, deployment, environment, ghcr, github, gpr, url
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/ghr-url
- Size: 1.54 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/funding.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ghr-url
[](https://github.com/flex-development/ghr-url-action/releases/latest)
[](https://github.com/flex-development/ghr-url-action/actions/workflows/test.yml)
[](https://github.com/voxpelli/badges-cjs-esm)
[](LICENSE.md)
[](https://conventionalcommits.org)
[](https://yarnpkg.com)
Create a URL for a GitHub registry
## Contents
- [What is this?](#what-is-this)
- [Use](#use)
- [Inputs](#inputs)
- [`container`](#container)
- [`pkg`](#pkg)
- [`repo`](#repo)
- [`server`](#server)
- [Outputs](#outputs)
- [`url`](#url)
- [Related](#related)
- [Contribute](#contribute)
## What is this?
This is a simple action for creating GitHub package and container registry URLs.
## 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/ghr-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
### `container`
> **default**: `false`
Whether to generate a URL for the GitHub Container Registry (GHCR) (optional).
### `pkg`
> **default**: `${{ github.event.repository.name }}`
The name of the package (optional).
### `repo`
> **default**: `${{ github.repository }}`
The name of the repository, including the owner (optional).
### `server`
> **default**: `${{ github.server_url }}`
The URL of the GitHub server (optional).
## Outputs
### `url`
The public registry URL.
## Related
- [`flex-development/gh-release-url-action`][gh-release-url-action] — create a url for a github release
- [`flex-development/npm-url-action`][npm-url-action] — create a url for the npm registry
## 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.
[gh-release-url-action]: https://github.com/flex-development/gh-release-url-action
[npm-url-action]: https://github.com/flex-development/npm-url-action