Job runs even if previous job failed - and "success() == true" ! #81

Closed
opened 2023-03-26 19:37:08 +00:00 by ghnp5 · 3 comments

Consider this workflow:

jobs:
  d_update_services:
    name: Test Services
    runs-on: ubuntu-latest
    steps:
      - name: Details
        run: echo "error" && exit 1
  z_complete:
    name: Complete Job
    runs-on: ubuntu-latest
    needs: d_update_services
    steps:
      - name: Details
        run: |
          echo "User: $(whoami)"
          echo "Shell: $SHELL"
          echo $BASH_VERSION
          ls -l $(which sh)
          echo ""
          echo "GITHUB_OUTPUT = $GITHUB_OUTPUT"
          echo "GITHUB_STEP_SUMMARY = $GITHUB_STEP_SUMMARY"
      - name: Job Succeeded
        if: success()
        run: |
          echo "Success"
      - name: Job Failed
        if: failure()
        run: |
          echo "Failure"
      - name: Job Canceled
        if: cancelled()
        run: |
          echo "Cancelled"

In GitHub Actions, the behavior is this:

image

image

In Gitea Actions, the behavior is this:

image

image

Consider this workflow: ``` jobs: d_update_services: name: Test Services runs-on: ubuntu-latest steps: - name: Details run: echo "error" && exit 1 z_complete: name: Complete Job runs-on: ubuntu-latest needs: d_update_services steps: - name: Details run: | echo "User: $(whoami)" echo "Shell: $SHELL" echo $BASH_VERSION ls -l $(which sh) echo "" echo "GITHUB_OUTPUT = $GITHUB_OUTPUT" echo "GITHUB_STEP_SUMMARY = $GITHUB_STEP_SUMMARY" - name: Job Succeeded if: success() run: | echo "Success" - name: Job Failed if: failure() run: | echo "Failure" - name: Job Canceled if: cancelled() run: | echo "Cancelled" ``` In GitHub Actions, the behavior is this: ![image](/attachments/65debc1a-5722-4814-bc02-ca0ec63deb3e) ![image](/attachments/5cc17999-68b3-4960-8b18-3906e76ca7a6) In Gitea Actions, the behavior is this: ![image](/attachments/4650a743-0b83-47a7-8ac4-aeba91e2cc3a) ![image](/attachments/0c036dc3-e043-4b79-996e-d29be568f556)
Author

If all the steps are in the same job, the "failure() = true", which is the expected and as per the GitHub Actions.

But if they are different jobs (as per my YAML above), with the "needs", the second job should be Skipped.

image

If the "needs" isn't present, then GitHub Actions runs the other job, and also makes "success() = true".

image

So, "success()" seems to be just per Job, and not per "Run/Workflow".

I believe the bug here, then, is just that "needs" is being ignored in Gitea Actions.

If all the steps are in the same job, the "failure() = true", which is the expected and as per the GitHub Actions. But if they are different jobs (as per my YAML above), with the "needs", the second job should be Skipped. ![image](/attachments/81ffcd3e-31e6-40e9-a35e-7955c6f419f3) If the "needs" isn't present, then GitHub Actions runs the other job, and also makes "success() = true". ![image](/attachments/4b3de3b1-129a-404f-93a3-3e8c3d82baf0) So, "success()" seems to be just per Job, and not per "Run/Workflow". I believe the bug here, then, is just that "needs" is being ignored in Gitea Actions.
102 KiB
110 KiB
Owner

Related to #77.

Related to #77.
wolfogre added the
kind
bug
label 2023-03-27 01:39:36 +00:00
Owner
Fixed by https://github.com/go-gitea/gitea/pull/23789
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/act_runner#81
No description provided.