Skip to content

Add Azure DevOps support with shared core comment logic #1

Description

@tupe12334

Summary

Add support for Azure DevOps Pipelines so the Worktree workspace link comment is posted on new work items, while keeping the core comment-building logic shared between platforms.

Motivation

Currently src/index.mjs is tightly coupled to GitHub Actions (@actions/core, @actions/github). Users on Azure DevOps should get the same experience — a comment with an Open workspace link posted automatically when a work item is created.

Proposed Architecture

Extract platform-agnostic logic into a shared module and implement thin platform adapters:

src/
  comment.mjs          # shared: builds the comment body given { owner, repo, issue }
  github/index.mjs     # GitHub Actions adapter: reads context, calls Octokit
  azure/index.mjs      # Azure DevOps adapter: reads pipeline env vars, calls ADO REST API

Shared (comment.mjs)

  • buildCommentBody({ owner, repo, issue }) — returns the markdown string with the badge and footer
  • No platform dependencies

GitHub adapter (github/index.mjs)

  • Reads owner, repo, issue_number from @actions/github context
  • Guards on issues.opened event
  • Posts comment via Octokit (issues.createComment)
  • Logs via @actions/core

Azure DevOps adapter (azure/index.mjs)

  • Reads owner, project, workItemId from ADO pipeline environment variables (SYSTEM_TEAMPROJECT, BUILD_REPOSITORY_NAME, etc.)
  • Guards on work item created event (ADO service hook or pipeline trigger)
  • Posts comment via Azure DevOps Work Item Comments REST API
  • Logs via console or azure-pipelines-task-lib

Open Questions

  • Should the Azure adapter be a separate action (new action.yml) or a new entry point in this repo?
  • Authentication: PAT vs service connection for ADO?
  • ADO equivalent of "issue opened" trigger — service hook vs pipeline step?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions