Skip to main content
  1. Writings/

GitHub Actions, Edge-cases, and Workarounds

·2 mins
standup platform engineering github actions
Imran Ali
Author
Imran Ali
A curious human learning as he grows.
Table of Contents
Welcome to my standups - a series where I share what I’m working on, thoughts rummaging around in my head, and what I’m excited for! 🚀

What I’m working on
#

I’ve missed a week to recover from what I think was one of the worst bouts with the flu in my lifetime. Phew, glad that’s over (almost - that darn post-nasal drip).

GitHub and its many edge cases
#

Docker Actions
#

Creating docker actions in javascript can work for many organizations, but for teams who perhaps come from different backgrounds/experiences and who want to avoid technical debt (using a language that people on the team don’t know so well), they might go the docker action route.

The setup for creating a python docker action is fairly straightforward:

Docker Action Setup
Python Docker Action Setup

You have your action.yml, main.py (and any other files/code needed for the action i.e requirements.txt etc.), and your Dockerfile.

Now when you’re in an enterprise environment, you may not like the fact that the Docker image registry defaults to public dockerhub.

1
2
3
4
5
FROM python:3-slim # This gets pulled from public dockerhub
WORKDIR /app
COPY . /app
RUN pip install --target=/app -r requirements.txt
CMD ["python", "/app/main.py"]
And even if you try to tag the image with your internal docker repository, GitHub doesn’t let you authenticate before trying to pull down the image when you call a docker action.

The workaround?

1
2
3
4
5
container:
  image: ghcr.io/owner/image
  credentials:
     username: ${{ secrets.USER }}
     password: ${{ secrets.TOKEN }}

Declare the job to run in a container and then call a shared script from another github repo to complete your work. It’s a bit messy, but it works!

Related

Legacy Apps and DevOps
·2 mins
standup platform engineering
DevOps Platform Engineering for GitHub
·2 mins
standup platform engineering
The CIA Triad
·2 mins
standup DevOps
Laying the Groundwork
·2 mins
standup playform engineering
Scaling DevOps Across an Enterprise
·2 mins
standup audit
My Public Speaking Journey
·2 mins