https://github.com/flex-development/gh-release-url-action
Create a URL for a GitHub registry
https://github.com/flex-development/gh-release-url-action
actions deploy deployment environment ghcr github gpr release url
Last synced: 4 months ago
JSON representation
Create a URL for a GitHub registry
- Host: GitHub
- URL: https://github.com/flex-development/gh-release-url-action
- Owner: flex-development
- License: bsd-3-clause
- Created: 2025-09-24T22:50:52.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-09-25T01:14:39.000Z (5 months ago)
- Last Synced: 2025-09-25T01:14:41.349Z (5 months ago)
- Topics: actions, deploy, deployment, environment, ghcr, github, gpr, release, url
- Language: TypeScript
- Homepage: https://github.com/flex-development/gh-release-url-action
- Size: 1.14 MB
- Stars: 0
- 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
# gh-release-url
[](https://github.com/flex-development/gh-release-url-action/releases/latest)
[](https://github.com/flex-development/gh-release-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 release
## Contents
- [What is this?](#what-is-this)
- [Use](#use)
- [Inputs](#inputs)
- [`artifact`](#artifact)
- [`owner`](#owner)
- [`repo`](#repo)
- [`server`](#server)
- [`tag-prefix`](#tag-prefix)
- [`version`](#version)
- [Outputs](#outputs)
- [`artifact`](#artifact-1)
- [`tag`](#tag)
- [`url`](#url)
- [Related](#related)
- [Contribute](#contribute)
## What is this?
This is a simple, but useful, action for creating GitHub release URLs.
## Use
```yaml
---
name: release
on:
pull_request:
branches:
- main
types:
- closed
env:
REF: ${{ github.event.pull_request.merge_commit_sha }}
REF_NAME: ${{ format('{0}@{1}', github.base_ref, github.event.pull_request.merge_commit_sha) }}
jobs:
preflight:
if: github.event.pull_request.merged && startsWith(github.head_ref, 'release/')
permissions:
contents: read
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.environment.outputs.tag }}
url: ${{ steps.environment.outputs.url }}
version: ${{ steps.version.outputs.manifest }}
steps:
- id: checkout
name: Checkout ${{ env.REF_NAME }}
uses: actions/checkout@v5.0.0
with:
ref: ${{ env.REF }}
- id: version
name: Get release version
uses: flex-development/manver-action@1.0.1
- id: tag-prefix
name: Get release tag prefix
uses: flex-development/jq-action@1.0.0
with:
data: grease.config.json
filter: .tagprefix
- id: environment
name: Get release url
uses: flex-development/gh-release-url-action@2.0.0
with:
tag-prefix: ${{ steps.tag-prefix.outputs.result }}
version: ${{ steps.version.outputs.manifest }}
publish:
needs: preflight
runs-on: ubuntu-latest
environment:
name: release
url: ${{ needs.preflight.outputs.url }}
env:
GITHUB_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
NOTES_FILE: RELEASE_NOTES.md
steps:
- id: checkout
name: Checkout ${{ env.REF_NAME }}
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
persist-credentials: true
ref: ${{ env.REF }}
token: ${{ env.GITHUB_TOKEN }}
- id: gpg-import
name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6.3.0
with:
git_config_global: true
git_push_gpgsign: false
git_tag_gpgsign: true
git_user_signingkey: true
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
trust_level: 5
- id: node
name: Setup Node.js
uses: actions/setup-node@v5.0.0
with:
cache: yarn
cache-dependency-path: yarn.lock
node-version-file: .nvmrc
- id: yarn
name: Install dependencies
run: yarn --no-immutable && echo "$GITHUB_WORKSPACE/node_modules/.bin" >>$GITHUB_PATH
- id: pack
name: Pack project
run: yarn pack -o %s-%v.tgz
- id: release-notes
name: Generate release notes
env:
TZ: ${{ vars.TZ }}
run: grease changelog -wo $NOTES_FILE && echo "$(cat $NOTES_FILE)" >>$GITHUB_STEP_SUMMARY
- id: tag
name: Create annotated tag
run: 'grease tag -ps -m "release: {tag}" ${{ needs.preflight.outputs.version }}'
- id: publish
name: Publish release
run: |
gh release create ${{ needs.preflight.outputs.tag }} *.tgz --title=${{ needs.preflight.outputs.tag }} --notes-file=$NOTES_FILE --verify-tag
```
## Inputs
### `artifact`
The name of the release artifact to create a download URL for (optional).
### `owner`
> **default**: `${{ github.repository_owner }}`
The repository owner (optional).
### `repo`
> **default**: `${{ github.event.repository.name }}`
The name of the repository (optional).
### `server`
> **default**: `${{ github.server_url }}`
The URL of the GitHub server (optional).
### `tag-prefix`
The prefix to append to the [release version](#version) when building the release tag component of the URL (optional).
### `version`
The release version or tag to create a URL for.
## Outputs
### `artifact`
The [release artifact](#artifact) download URL.
### `tag`
The release tag the URLs were created with.
### `url`
The release URL.
## Related
- [`flex-development/ghr-url-action`][ghr-url-action] — create a url for a github registry
- [`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.
[ghr-url-action]: https://github.com/flex-development/ghr-url-action
[npm-url-action]: https://github.com/flex-development/npm-url-action