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

Add image name as input #77

Closed

Conversation

jarredhawkins
Copy link

After the rate limit changes introduced by docker on Github actions, we're getting rate limited since the action pulls a fresh image from the docker hub on each run.

Allow changing the image name via config, which allows us to self-host/proxy the base Golang image.

Fixes #69

@jarredhawkins
Copy link
Author

jarredhawkins commented Jul 16, 2024

Eh might have gotten ahead of myself here, not sure build-args are supported for the default docker runner

This is true, but can inject with syntax: docker://alpine:3.8

Seems like you can't use inputs in the image context.

@jarredhawkins
Copy link
Author

After battling a few different approaches here, I ended up building and pushing my own modified dockerfile to ghcr.io with the ENTRYPOINT line removed. (Make sure you give whatever repo you're working in read access to this inside of the settings for the artifact -- this doesn't happen inside of the action config itself)

From there, modified a github action:

jobs:
  merge-gatekeeper:
    container:
      image: ghcr.io/your-path-here/merge-gatekeeper:0.0.1
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - name: Run Merge Gatekeeper
        run: |
          /go/bin/merge-gatekeeper validate \
            --token=${{ secrets.GITHUB_TOKEN }} \
            --ref=${{ github.event.pull_request.head.sha }} \
            --interval=60 \
            --timeout=2100 \
            --ignored="ignore job input here"

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.

Hitting Docker rate limit and ways to avoid that
1 participant