Skip to content

if: ${{ github.event_name != 'workflow_call' }} not working #3146

Description

@kenorb

Describe the bug

I'm reusing workflow by calling it from another repo, like:

jobs:
  test:
    uses: org/repo/.github/workflows/test.yml

And inside re-used workflow I've defined the following condition:

on:
  workflow_call:

jobs:
 cleanup:
   if: ${{ github.event_name != 'workflow_call' }}
   runs-on: ubuntu-latest
   steps:
     - uses: geekyeggo/delete-artifact@v4
       with:
         name: *

The issue is that if: ${{ github.event_name != 'workflow_call' }} condition doesn't work.

Expected behavior

I'm expected that job not to run from the calling workflow (uses: org/repo...).
So I want to call the job when I'm running workflow in the same repo.

Runner Version and Platform

2.312.0

OS of the machine running the runner?

Linux

What's not working?

Condition doesn't work as expected.

It's possible that conditions for workflows calls are ignored, because I've tested with different condition, and it didn't work either.

No activity

Activity on this issue will appear here.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions