hoverkraft-tech/compose-action

False positive when docker-compose.yml is not found

Closed this issue · 6 comments

The action passes successfully even if the compose file is not found. This could result in a typo causing a false positive. The action should fail if the docker-compose.yml file is missing.

Run isbang/compose-action@v1.4.1
  
./docker-compose.yml not exists

I have a docker-compose.yaml (yaml instead of yml) which is detected just fine with docker-compose however is ignored with the action.

This is my workflow file:

---
name: commit

on:
  - push

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      DOCKER_BUILDKIT: 1
      COMPOSE_DOCKER_CLI_BUILD: 1
    steps:
      - uses: actions/checkout@v3
      - uses: isbang/compose-action@v1.4.1
        with:
          up-flags: --exit-code-from gentoo

How to reproduce

  1. Create a docker-compose.yaml
  2. Create the workflow file without specifying compose-file

Actual behavior

Job passes successfully

Expected behavior

Job fails with message explaining the docker-compose file is not found.

Me too.
Message: docker/docker-compose-test.yml not exists

humb1t commented

+1

joergi commented

+1 here.

This issue is stale

Thanks for this check. However, it appears that it may be checking for the docker-compose.yml file relative to the current working directory, so if you have specified an absolute path to the compose-file, then the check fails even though the file is in the right location for the build. Example from a run I tried:

Run hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: /runner/_work/myrepo/myrepo/myaction/docker/docker-compose.yml
cwd: /runner/_work/myrepo/myrepo
env:
GH_TOKEN: ***
WORK_DIR: /runner/_work/myrepo/myrepo/myaction/build/work
HOME: /runner/_work/myrepo/myrepo/myaction
... some other environment variables
Error: Error: /runner/_work/myrepo/myrepo/myaction/docker/docker-compose.yml does not exist in /runner/_work/myrepo/myrepo