GitHub checks in combination with allowed-to-fail GitHub Action

When using an allowed-to-fail GitHub Action and it does fail (who figured :slight_smile:) the GitHub check icon is a red cross. I’d have hoped that in case an allowed-to-fail Action (or Actions) is the only failing job we would get a different feedback (maybe a yellow-greenish half-check mark or something along these lines).

:wave: Hey @DeepSpace2,

Could you describe your workflow and how you’re allowing an action to fail?

With a step like:

    steps:
      - run: exit 1
        continue-on-error: true

The job itself still succeeds.

Example: Create continue-on-error.yml · joshmgross/actions-testing@1b25d80 · GitHub

https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error

Hi. This is my entire workflow .yml file:

name: test

on:
  push:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    name: Python ${{ matrix.python-version }}
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.6, 3.7, 3.8, 3.9]
        experimental: [false]
        include:
          - python-version: 3.10-dev
            experimental: true

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        if: "!endsWith(matrix.python-version, '-dev')"
        with:
          python-version: ${{ matrix.python-version }}
      - name: Set up Python ${{ matrix.python-version }}
        uses: deadsnakes/action@v1.0.0
        if: endsWith(matrix.python-version, '-dev')
        with:
          python-version: ${{ matrix.python-version }}
      - name: Installing dependencies Python ${{ matrix.python-version }}
        run: |
          pip install -r requirements.txt
          pip install codecov coverage
      - name: Running tests Python ${{ matrix.python-version }}
        run: |
          coverage run -m unittest discover
          coverage xml
      - name: Uploading coverage Python ${{ matrix.python-version }}
        uses: codecov/codecov-action@v1

The problem is not that the workflow fails. The problem is that the icon is a red cross, which is a misleading indication.

If you set continue-on-error for the specific step that you expect to fail, the job itself should show as a success.

1 Like