I have an action.yml file and a Dockerfile in repository A like this:
Repository A
action.yml
[...]
runs:
using: 'docker'
image: 'Dockerfile'
[...]
Dockerfile
FROM hello-world
# do something
Now in repository B, I use the action and the Dockerfile:
Repository B
.github/workflows/hello.yml
name: hello
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: username/repoa@master
My point of using the Dockerfile in repository A is, among other things:
- that the GitHub action log is not cluttered with preparation steps which have no relation to the action in repository B
- so that it only builds when username/repoa is updated, not when username/repob is updated, because the Dockerfile didn't change.
However in practice, GitHub will happily rebuild the Dockerfile everytime I commit to username/repob and clutter the GitHub action logs with it.
How can I tell GitHub to only build the Dockerfile when repository A is updated and keep it out of the action logs?