[GH-ISSUE #1367] Support needs.*.result #725

Closed
opened 2026-03-01 21:45:51 +03:00 by kerem · 0 comments
Owner

Originally created by @tylermichael on GitHub (Sep 30, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1367

Act version

0.2.31

Feature description

Act is missing support for the result property in the needs context object. This property tells you if a job succeeded or failed.

https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context

I expect this workflow to work, but needs.build.result is not defined when running with act.

name: Build and deploy
on: push

jobs:
  build:
    runs-on: ubuntu-latest
    outputs:
      build_id: ${{ steps.build_step.outputs.build_id }}
    steps:
      - uses: actions/checkout@v3
      - name: Build
        id: build_step
        run: |
          ./build
          echo "::set-output name=build_id::$BUILD_ID"
  deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - run: ./deploy --build ${{ needs.build.outputs.build_id }}
  debug:
    needs: [build, deploy]
    runs-on: ubuntu-latest
    if: ${{ needs.build.result == 'failure' }}
    steps:
      - uses: actions/checkout@v3
      - run: ./debug
Originally created by @tylermichael on GitHub (Sep 30, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1367 ### Act version 0.2.31 ### Feature description Act is missing support for the `result` property in the needs context object. This property tells you if a job succeeded or failed. https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context I expect this workflow to work, but `needs.build.result` is not defined when running with act. ``` name: Build and deploy on: push jobs: build: runs-on: ubuntu-latest outputs: build_id: ${{ steps.build_step.outputs.build_id }} steps: - uses: actions/checkout@v3 - name: Build id: build_step run: | ./build echo "::set-output name=build_id::$BUILD_ID" deploy: needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: ./deploy --build ${{ needs.build.outputs.build_id }} debug: needs: [build, deploy] runs-on: ubuntu-latest if: ${{ needs.build.result == 'failure' }} steps: - uses: actions/checkout@v3 - run: ./debug ```
kerem 2026-03-01 21:45:51 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
starred/act#725
No description provided.