Skip to content

Enhancement: Accept pull request labels as input to verify-release-intent workflow #85

Description

@cratis-direct

Problem

The verify-release-intent.yml reusable workflow currently tries to access github.event.pull_request.labels directly, which is not available in the workflow_call context. This causes the workflow to always see an empty labels list, even when the calling PR has the required labels.

Solution

Modify the reusable workflow to accept labels as an explicit input parameter from calling workflows. This allows repositories to pass PR labels to the reusable workflow where they can be verified.

Changes needed:

  1. Add an inputs section to the workflow_call trigger:

    on:
      workflow_call:
        inputs:
          labels:
            type: string
            required: false
            default: '[]'
            description: 'JSON array of label names from the pull request'
  2. Update the environment variable to use the input:

    env:
      LABELS: ${{ inputs.labels }}

This makes the workflow compatible with all repositories that need to verify release intent labels. Calling workflows (like those in Arc.Kotlin, Arc.JavaScript, etc.) would pass labels like:

with:
  labels: ${{ toJSON(github.event.pull_request.labels.*.name) }}

Impact

This is a backwards-compatible change (with a default empty array), but all calling workflows would need to be updated to pass the labels explicitly to work correctly. This prevents the common issue where PRs with valid labels fail the verification due to context limitations in reusable workflows.

Related Issues

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions