diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b4b191d..9924dad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,8 @@ -on: [push] +on: [push, workflow_dispatch] env: VERSION: "1.0.${{ github.run_number }}" + PACKAGE_NAME: npm-publish jobs: publish: @@ -37,3 +38,15 @@ jobs: run: gh api repos/${{ github.repository_owner }}/npm-install/dispatches <<< '{"event_type":"build"}' --input - env: GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + + retention-policy: + runs-on: ubuntu-latest + + needs: [publish] + + steps: + - name: Retain 10 most recent versions + uses: actions/delete-package-versions@32b30cfe627e87fa3a77027be5c3663bc3abbb77 + with: + package-name: ${{ env.PACKAGE_NAME }} + min-versions-to-keep: 10