Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reusable workflow should be skipped #327

Open
AurelienGasser opened this issue Apr 28, 2023 · 1 comment
Open

reusable workflow should be skipped #327

AurelienGasser opened this issue Apr 28, 2023 · 1 comment

Comments

@AurelienGasser
Copy link

AurelienGasser commented Apr 28, 2023

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/skip-duplicate-actions@v5.3.0
        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

@AurelienGasser AurelienGasser changed the title no_transferable_run with reusable workflow reusable workflow is not skipped May 6, 2023
@AurelienGasser AurelienGasser changed the title reusable workflow is not skipped reusable workflow should be skipped May 6, 2023
@george-palmsens
Copy link

We've run into this too, I think it would be a very useful change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants