diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index 19d95f8825..41b023688a 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -1,5 +1,15 @@ name: Node.js Package Alpha -on: workflow_dispatch +on: + workflow_dispatch: + inputs: + preid: + description: 'Preid used to publish package. Must be unique per branch.' + required: true + default: 'alpha' + ref: + description: 'Commit to deploy from. Defaults to branch used for workflow_dispatch action.' + required: false + default: '' jobs: build: runs-on: ubuntu-latest @@ -8,6 +18,8 @@ jobs: packages: write steps: - uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.ref }} # Setup .npmrc file to publish to GitHub Packages - uses: actions/setup-node@v2 with: @@ -15,6 +27,6 @@ jobs: registry-url: 'https://npm.pkg.github.com' - run: npm install - run: npm run build - - run: ./node_modules/.bin/lerna publish --canary --registry https://npm.pkg.github.com --yes + - run: ./node_modules/.bin/lerna publish --canary --preid ${{ github.event.inputs.preid }} --registry https://npm.pkg.github.com --yes env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}