Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid listing org packages where job token doesn't have access #23

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

mering
Copy link
Contributor

@mering mering commented Aug 21, 2023

This allows using the job token directly.

Example workflow:

permissions:
  packages: write

jobs:
  cleanup-images:
    runs-on: ubuntu-22.04
    steps:
      - name: Cleanup untagged images
        uses: mering/delete-untagged-ghcr-action@main
        with:
          token: ${{ github.token }}
          repository_owner: ${{ github.repository_owner }}
          repository: ${{ github.repository }}
          package_name: IMAGE_NAME
          untagged_only: true
          owner_type: org

@mering mering changed the title Avoid listing org packages where repo token doesn't have access Avoid listing org packages where job token doesn't have access Aug 21, 2023
It's possible if you set permissions packages:write
and specify the image name explicitly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants