name: Remove temporary build context on: workflow_call: jobs: cleanup: runs-on: ubuntu-latest permissions: actions: write steps: - name: Delete this run's temporary package archives env: GH_TOKEN: ${{ github.token }} run: | artifacts="repos/$GITHUB_REPOSITORY/actions/artifacts" ids=$(gh api --paginate "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/artifacts?per_page=100" \ --jq ".artifacts[] | select(.name == \"workspace-build\" or .name == \"npm-release-$GITHUB_RUN_ID\") | .id") for id in $ids; do gh api --method DELETE "$artifacts/$id" done