Skip to content

Add git_resources input for per-step Git resource refs (SF-2251)#704

Closed
NickJosevski wants to merge 1 commit into
OctopusDeploy:mainfrom
NickJosevski:sf2251-git-resources
Closed

Add git_resources input for per-step Git resource refs (SF-2251)#704
NickJosevski wants to merge 1 commit into
OctopusDeploy:mainfrom
NickJosevski:sf2251-git-resources

Conversation

@NickJosevski

Copy link
Copy Markdown
Contributor

Draft — depends on OctopusDeploy/api-client.ts#279. See "Dependency" below.

What

Adds a new git_resources action input that lets a release target a specific Git reference for a step's Git resource at release-creation time.

Format (multi-line, mirrors the Octopus CLI --git-resource flag):

- uses: OctopusDeploy/create-release-action@v4
  with:
    project: "My Argo Project"
    git_resources: |
      Update Argo CD Application Manifests:${{ github.head_ref || github.ref_name }}

StepName:GitRef or StepName:GitResourceName:GitRef.

Why

For version-controlled / Argo CD projects, the branch a step's Git resource points at is resolved at release creation, before Octopus variables are evaluated — so it could not previously be set from GitHub Actions (variables resolve too late, defaulting the release to main). The server API, Go SDK, and CLI already support this via gitResources; only the Action lacked an input. This closes that gap.

Customer request SF-2251: deploy a feature branch to Dev from GitHub Actions by pointing the Update Argo CD Application Manifests step at the pushed branch.

How it flows

git_resources input → InputParameters.gitResourcesCreateReleaseCommandV1.GitResourcesPOST /releases/create/v1. The step's SelectedGitResources on the created release then reflect the chosen ref.

Verification

Proven end-to-end against a real Octopus instance + a version-controlled Argo project: the built dist (run exactly as the runner invokes it) created a release whose SelectedGitResources targeted the feature branch's commit, and a real GitHub-hosted-runner workflow (push + pull_request) produced the same result.

Tests

Unit test asserting git_resources is parsed into gitResources (single and named-resource forms).

Dependency (why this is a draft)

Requires GitResources on CreateReleaseCommandV1 from OctopusDeploy/api-client.ts#279. Until that ships, package.json temporarily sources @octopusdeploy/api-client from the companion PR branch. Before merge: bump to the published api-client version and rebuild dist.

🤖 Generated with Claude Code

Adds a 'git_resources' multi-line input mapping to the release-create API's
GitResources field, so a release can target a specific Git ref for a step's
Git resource at creation time (format: StepName:GitRef or
StepName:GitResourceName:GitRef).

This lets version-controlled/Argo projects deploy a feature branch from
GitHub Actions by pointing steps like 'Update Argo CD Application Manifests'
at the pushed branch (SF-2251).

Depends on OctopusDeploy/api-client.ts#279 (adds GitResources to
CreateReleaseCommandV1). The dependency is temporarily sourced from that PR
branch and must be switched to the published version before merge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@NickJosevski

Copy link
Copy Markdown
Contributor Author

Reopening from an in-org branch (OctopusDeploy:sf2251-git-resources) with the diff trimmed to source only.

@NickJosevski
NickJosevski deleted the sf2251-git-resources branch July 17, 2026 12:18
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