1

I have the following github actions/workflow file below. Behave execution skips the report upload to allure if any test fails or raise an exception. I was able to fix it by using always() on the next step, but unfortunately now the reports are being uploaded even when we are running the tests manually, and we'd like to upload only when scheduled (daily basis). Does anybody know how to achieve this?

...
    - name: Run BDD tests
      env:
        STAGE_EMAIL: ${{ secrets.STAGE_EMAIL }}
        STAGE_PASSWORD: ${{ secrets.STAGE_PASSWORD }}
      run: |
        rm -rf allure-results
        mkdir -p allure-results
        behave --junit --junit-directory allure-results

    - name: Upload test report to Allure
      if: ${{ always() }} && github.event_name == 'schedule'
      env:
        ALLURE_SERVER: ${{ secrets.ALLURE_SERVER }}
      run: |
        python send_test_results.py $GITHUB_REPOSITORY $GITHUB_RUN_ID $ALLURE_SERVER default
...
3
  • Please try ${{ always() } && github.event_name == 'schedule' } Commented Sep 23, 2021 at 9:27
  • That was ALMOST it. Moving both curly brackes to the right worked. Like this: ${{ always() && github.event_name == 'schedule' }} . Thanks @KrzysztofMadej ! Commented Sep 25, 2021 at 23:03
  • Indeed i had mistake Commented Sep 26, 2021 at 6:20

1 Answer 1

4

This expression will do what you want ${{ always() && github.event_name == 'schedule' }}.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.