If you run this action without an NPM_TOKEN it'll perform a --drun-run publish.
Consumers wishing to perform a --dry-run can now do so by adding a new job just prior to the job performing the actual npm publish.
An example configuration would look something like:
publish-npm-dry-run:
runs-on: ubuntu-latest
needs: publish-release
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.sha }}
- uses: actions/cache@v3
id: restore-build
with:
path: ./dist
key: ${{ github.sha }}
# Set `ignore-scripts` to skip `prepublishOnly` because the release was built already in the publish-release job
- run: npm config set ignore-scripts true
- name: Publish
uses: MetaMask/action-npm-publish@v1.0.0
publish-npm:
environment: npm-publish
runs-on: ubuntu-latest
needs: publish-npm-dry-run
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.sha }}
- uses: actions/cache@v3
id: restore-build
with:
path: ./dist
key: ${{ github.sha }}
# Set `ignore-scripts` to skip `prepublishOnly` because the release was built already in the publish-release job
- run: npm config set ignore-scripts true
- name: Publish
uses: MetaMask/action-npm-publish@v1.0.0
with:
npm-token: ${{ secrets.NPM_TOKEN }}
This means a person coming in to approve the final npm publish job run can view the output of the dry-run job preceding it and verify the publish is going to do what's expected.
Add
--dry-run
as default.If you run this action without an
NPM_TOKEN
it'll perform a--drun-run
publish.Consumers wishing to perform a
--dry-run
can now do so by adding a new job just prior to the job performing the actual npm publish.An example configuration would look something like:
This means a person coming in to approve the final npm publish job run can view the output of the dry-run job preceding it and verify the publish is going to do what's expected.
closes: #3