Skip to content

reusable workflow should be skipped #327

@AurelienGasser

Description

@AurelienGasser

When a workflow is reused, it is not skipped even though it ran successfully before.

Repro

  • Step 1. Run a reusable workflow with a skippable job: the skippable job is not skipped
  • Step 2. Run the reusable workflow again: the skippable job is skipped because it was already run in Step 1
  • Step 3. Run a caller workflow which calls the reusable workflow: the skippable job is not skipped
    • Expected behavior: the skippable job in the called workflow is skipped because it was already run in Step 1.
    • Actual behavior: the skippable job in the called workflow is not skipped (no_transferable_run)

Files

# test-child.yaml
name: Test (child)
on:
  workflow_dispatch:
  workflow_call:

permissions:
  actions: write
  contents: read

jobs:
  skip:
    runs-on: ubuntu-latest
    outputs:
      should_skip: ${{ steps.skip_check.outputs.should_skip }}
    steps:
      - id: skip_check
        uses: fkirc/[email protected]
        with:
          do_not_skip: '[]'

  actual-work:
    needs: skip
    if: needs.skip.outputs.should_skip != 'true'
    runs-on: ubuntu-latest
    steps:
      - name: hello
        run: echo Hello
# test-parent.yaml
name: Test (parent)
on:
  workflow_dispatch:

permissions:
  actions: write
  contents: read

jobs:
  call-child:
    uses: <owner_redacted>/<repo_redacted>/.github/workflows/test-child.yaml@<branch_redacted>

Workflow runs

Step 1.

image

Step 2.

image

Step 3.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions