Skip to content

[wip] chore: add publish npm action #1

[wip] chore: add publish npm action

[wip] chore: add publish npm action #1

name: Publish NPM (Manual)
on:
workflow_dispatch:
inputs:
release_tag:
type: string
required: true
description: Release Tag to Publish
jobs:
validate_tag:
uses: actions/github-script@v7

Check failure on line 13 in .github/workflows/publish.dispatch.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.dispatch.yml

Invalid workflow file

invalid value workflow reference: references to workflows must be rooted in '.github/workflows'
with:
script: |
const tag = '';
let exhausted = false;
let page = 1;
while (!exhausted) {
const releases = octokit.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
page,
per_page: 100,
});
const matchingRelease = releases.find(r => r.tag_name === tag);
if (matchingRelease) {
core.setOutput('hasRelease', true);
core.setOutput('isPrerelease', release.prerelease);
return;
}
if (releases.length < 100) {
exhausted = true;
} else {
page++
}
}
core.setOutput('hasRelease', false);
core.setOutput('isPrerelease', false);
publish_npm:
needs: validate_tag
uses: ./.github/workflows/publish.reusable.yml
with:
release-tag: ${{ github.event.inputs.release_tag }}
secrets: inherit