I am writing a GitHub workflow to run some CI/CD pipelines.
In particular, I am running commands through a docker-compose build command. My command fails, but the workflow passes anyway. Is there an explanation for that?
Here is my yaml file:
name: complete build
on: [pull_request, workflow_call]
jobs:
lintage-checks:
runs-on: ubuntu-22.04
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
container:
image: lucasalt/act_base:latest # Use to get the docker-compose command
steps:
- uses: act10ns/slack@v2
with:
status: starting
message: Pull request opened successfully by ${{ github.event.pull_request.user.login }}
if: always()
- uses: actions/checkout@v3 # Use to copy the files from current directory
- name: Complexity
run: |
docker-compose -f scripts/docker_lintage/docker-compose.yaml up --build complexity
- uses: act10ns/slack@v2
with:
status: ${{job.status}}
steps: ${{toJson(steps)}}
if: always()
However, when I create a pull request, what I get in github log is the following
Creating complexity ... done
Attaching to complexity
complexity | scripts/lintage/complexity.sh
complexity | SCORE : 1.3333333333333333 | Acceptable score : 2
complexity | scripts/lintage/complexity.sh: line 5: bc: command not found
complexity | Sorry, complexity score is not acceptable."
complexity | make: *** [Makefile:20: test_complexity] Error 1
complexity exited with code 2
but the workflow is considered passed as you can see from the screenshot.
If I do not build the image but simply run the bash commands, I get the failure as I expect.