Skip to content

Replace peter-evans/dockerhub-description and snok/container-retention-policy with first-party alternatives#370

Draft
Copilot wants to merge 1 commit intomasterfrom
copilot/analyze-and-replace-dockerhub-actions
Draft

Replace peter-evans/dockerhub-description and snok/container-retention-policy with first-party alternatives#370
Copilot wants to merge 1 commit intomasterfrom
copilot/analyze-and-replace-dockerhub-actions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Eliminates two third-party GitHub Actions dependencies by reimplementing their functionality directly using the Docker Hub REST API and GitHub's gh CLI.

push-container-images.ymlpeter-evans/dockerhub-description

Replaced with a PowerShell run step (consistent with the job's existing shell: pwsh default) that authenticates via POST /v2/users/login and updates the repo description via PATCH /v2/repositories/{repo}/. Secrets are passed through env vars rather than inline interpolation.

clean-ghcr.ymlsnok/container-retention-policy

Replaced with a bash run step using gh CLI and jq (both pre-installed on ubuntu-latest) against the GitHub Packages API. Paginates all versions, filters by tag pattern (pr-* / *-alpha.*) and a 2-week updated_at cutoff, then bulk-deletes matches. Added explicit packages: write permission to the job.

gh api --paginate "/orgs/particular/packages/container/servicecontrol-masstransit-connector/versions" \
  | jq -r --arg cutoff "$CUTOFF" '
      .[]
      | select(
          (.metadata.container.tags | map(test("^pr-") or test("-alpha\\.")) | any) and
          (.updated_at < $cutoff)
        )
      | .id' \
  | while IFS= read -r version_id; do
      gh api --method DELETE ".../versions/$version_id"
    done

…n-policy with built-in alternatives

Agent-Logs-Url: https://github.com/Particular/ServiceControl.Connector.MassTransit/sessions/b19a6243-2864-43b0-9eca-3292192a2f63

Co-authored-by: afprtclr <208591451+afprtclr@users.noreply.github.com>
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