Skip to content

Actions: reusable workflow job fails before scheduling when passing a declared secret #39064

Description

@luketainton

Gitea Version

1.27.2

What happened?

A job that calls an external reusable workflow fails during scheduling when the called workflow declares a secret and the caller passes that secret through jobs.<job_id>.secrets.

The job receives no runner, has no steps or log output, and fails before the called workflow's first step. Moving the secret-consuming step into a normal runs-on job in the caller succeeds.

Minimal reproduction

Caller workflow:

name: caller
on: workflow_dispatch

jobs:
  call:
    uses: https://gitea.example.test/shared/workflows/.gitea/workflows/reusable.yaml@main
    secrets:
      TEST_SECRET: ${{ secrets.TEST_SECRET }}

Called workflow:

name: reusable
on:
  workflow_call:
    secrets:
      TEST_SECRET:
        required: true

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: test -n "${{ secrets.TEST_SECRET }}"

Expected behaviour

The reusable-workflow job should be scheduled on a runner and receive the secret declared by on.workflow_call.secrets.

Actual behaviour

The caller job fails before a runner is assigned and before any steps run. There is no diagnostic explaining why the passed secret prevents scheduling.

Workaround

Perform the secret-consuming step in a normal job in the caller workflow.

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

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions