Skip to content

Handle PullRequest/Action casing in event payloads to detect merged PRs #260

Description

Summary

The Get-PSModuleSettings action treats merged PRs as abandoned when the event payload uses PullRequest/Action (PascalCase) keys instead of pull_request/action.

Context

The GoogleFonts workflow emits event data with PullRequest and Action properties. When a PR is closed and merged, the evaluated settings show:

  • GITHUB_EVENT_NAME: pull_request
  • GITHUB_EVENT_ACTION: closed
  • GITHUB_EVENT_PULL_REQUEST_MERGED: False
  • isAbandonedPR: True
  • isMergedPR: False

This causes Publish-Module to run immediately as if the PR was abandoned.

Expected

Merged PRs should be detected correctly even when the event payload uses PullRequest and Action casing.

Actual

Merged PRs are treated as abandoned.

Repro

  1. Trigger the workflow on a merged PR with event payload keys PullRequest/Action (example payload from GoogleFonts workflow).
  2. Observe the calculated values in Get-PSModuleSettings.

Proposed fix

Check both action and Action, and both pull_request and PullRequest when determining PR action and merged status.

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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions