Cleanup PR preview packages #285
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cleanup PR preview packages | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0/6 * * 6,0' | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
cleanup: | |
name: Cleanup PR Previews | |
runs-on: ubuntu-latest | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLIC_PUBLISH }} | |
GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }} | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v4 | |
- name: Prepare cleanup | |
id: prepare | |
run: | | |
echo "openPRs=$(gh pr list --state open --json number|jq -cM 'map(.number|tostring)')" >> $GITHUB_OUTPUT | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN_PUBLIC_PUBLISH }}" > .npmrc | |
- name: Cleanup PR preview | |
uses: Kong/public-shared-actions/pr-previews/cleanup@main | |
with: | |
package: "@kong/kong-auth-elements" | |
openPRs: ${{ steps.prepare.outputs.openPRs }} |