Skip to content

Conversation

mjcheetham
Copy link
Member

@mjcheetham mjcheetham commented Aug 29, 2025

Based on #1247

Introduce a new sub-package that is an Azure Pipelines task, that wraps the logic from the GitHub action.

Most of the @actions/core functions have 1:1 equivalents in Azure Pipelines, so we can easily port the action logic into an Azure task instead.

@actions/cache doesn't have the same integration, but consumers can use the Cache@2 task directly in their pipeline YAML instead.

Note that due to difference in the task/action definition schema, some of the input names cannot be exactly the same. Namely the github-token action input is not a valid task input, due to the '-'. We maintain a mapping of GitHub Actions ➡️ Azure Pipelines input names and do the translation in our ICore implementation.

Running npm run build followed by npm run package will use ncc to compile all the task code into a single index.js file, and then use the tfx CLI to create a VSIX extension that can be published to the Azure DevOps Marketplace.

@mjcheetham mjcheetham requested a review from dscho August 29, 2025 11:08
Introduce a simple abstraction of the @actions/core module, such that we
can provide a different implementation in the future (for Azure
Pipelines, for example).

Rename 'run' to 'setup' (which is the sibling to 'cleanup'), and add a
new 'run' function that takes only an ICore implementation, using
@actions/core.

Signed-off-by: Matthew John Cheetham <[email protected]>
In a similar way to @actions/core, we abstract the @actions/cache
functions.

Signed-off-by: Matthew John Cheetham <[email protected]>
Move the shared orchestration logic of the action out of main.ts into a
new file src/action.ts. The main.ts file now just calls through to the
run() function, with an ICore instance using @actions/core and
@actions/cache.

Signed-off-by: Matthew John Cheetham <[email protected]>
@mjcheetham mjcheetham force-pushed the azp-task branch 3 times, most recently from d113708 to 52b0db4 Compare August 29, 2025 11:22
Introduce a new sub-package that is an Azure Pipelines task, that wraps
the logic from the GitHub action.

Most of the @actions/core functions have 1:1 equivalents in Azure
Pipelines, so we can easily port the action logic into an Azure task
instead.

@actions/cache doesn't have the same integration, but consumers can use
the Cache@2 task directly in their pipeline YAML instead.

Note that due to difference in the task/action definition schema, some
of the input names cannot be exactly the same. Namely the `github-token`
action input is not a valid task input, due to the '-'. We maintain a
mapping of GitHub Actions -> Azure Pipelines input names and do the
translation in our ICore implemention.

Running `npm run build` followed by `npm run package` will use `ncc` to
compile all the task code into a single index.js file, and then use the
`tfx` CLI to create a VSIX extension that can be published to the Azure
DevOps Marketplace.

Signed-off-by: Matthew John Cheetham <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant