In the absence of a Dockerfile, we should simply remove the workflow from the directory. That being said, we could remove this problematic step from the workflow. In summary, if no Dockerfile was found, we performed an early exit. However, this early exit affected all workflows in the "run".
- name: Check if a Dockerfile is present at the root of the repo
id: check-file
run: |
if [ -f Dockerfile ]; then
echo "::set-output name=exists::true"
else
echo "::set-output name=exists::false"
- name: Early exit if no Dockerfile is present
if: steps.check-file.outputs.exists == 'false'
run: |
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
In the absence of a Dockerfile, we should simply remove the workflow from the directory. That being said, we could remove this problematic step from the workflow. In summary, if no Dockerfile was found, we performed an early exit. However, this early exit affected all workflows in the "run".