Skip to content

always() vs job cancellation #129

Description

@dungdm93

When a job received cancellation request, steps with condition always() still eligible to be run normally. However go context.Context() is canceled, so that steps will be failed.

Find the way handle this edge case properly.

actions/runner logic:

  • the job status is marked as cancelled
  • the step’s condition is re-evaluated
    • if fail, cancel the step
    • if true, the step is continue running

Normal steps and embedded steps, the step CancellationTokenSource is not linked to the parent/job token.

ref: https://github.com/actions/runner/blob/v2.335.1/src/Runner.Worker/StepsRunner.cs#L149-L186

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions