Skip to content

feat: add git_resources input for per-step Git resource refs (SF-2251)#705

Open
NickJosevski wants to merge 1 commit into
mainfrom
sf2251-git-resources
Open

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

Conversation

@NickJosevski

Copy link
Copy Markdown

Draft — source-only for review. Depends on OctopusDeploy/api-client.ts#280. Dependency bump + dist rebuild are deferred to ready-time (see "Landing" below), which is why this diff is just the 12-line source change and no regenerated bundle.

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).

Landing (why this is a draft)

Requires GitResources on CreateReleaseCommandV1 from OctopusDeploy/api-client.ts#280. Once that merges and publishes:

  1. Bump @octopusdeploy/api-client to the published version.
  2. npm run build to regenerate dist/index.js.
  3. Mark ready for review.

🤖 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#280 (adds GitResources to
CreateReleaseCommandV1). Dependency bump + dist rebuild are deferred to
ready-time once that ships.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@NickJosevski NickJosevski changed the title Add git_resources input for per-step Git resource refs (SF-2251) feat: add git_resources input for per-step Git resource refs (SF-2251) Jul 20, 2026
@NickJosevski
NickJosevski marked this pull request as ready for review July 20, 2026 01:30
@NickJosevski
NickJosevski requested a review from a team as a code owner July 20, 2026 01:30
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