How to ignore skipped job with needs and if #610

Open
opened 2024-10-16 02:20:47 +00:00 by JupiterFeng · 0 comments
JupiterFeng commented 2024-10-16 02:20:47 +00:00 (Migrated from gitea.com)

I'm using job execution to build and run dockercompose
I want to be able to control the build and run with ENV
Initially I came across if Gitea used multiple runners
Then the pipelines will be parallel
The job that causes the run will run at the same time as the build
Later I tried to control it with needs, but referenced some github actions examples

  step2:
    runs-on: act-22.04
    steps:
      - name: Check out repository code
        run: ls
  step3:
    runs-on: act-22.04
    if: ${{ always() && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) }}
    needs: [step1, step2]
    steps:
      - name: always
        run: ls

dont work
but only use ${{ always()}} can run step3

I'm using job execution to build and run dockercompose I want to be able to control the build and run with ENV Initially I came across if Gitea used multiple runners Then the pipelines will be parallel The job that causes the run will run at the same time as the build Later I tried to control it with needs, but referenced some github actions examples ``` step2: runs-on: act-22.04 steps: - name: Check out repository code run: ls step3: runs-on: act-22.04 if: ${{ always() && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) }} needs: [step1, step2] steps: - name: always run: ls ``` dont work but only use ${{ always()}} can run step3
Sign in to join this conversation.