Skip to content

feat: add git-sha parameter to support deploying from specific commits#228

Merged
maoanran merged 1 commit intomainfrom
add-git-sha-support
Feb 6, 2026
Merged

feat: add git-sha parameter to support deploying from specific commits#228
maoanran merged 1 commit intomainfrom
add-git-sha-support

Conversation

@maoanran
Copy link
Contributor

@maoanran maoanran commented Feb 6, 2026

Add optional git-sha input parameter to deploy workflows to enable building and deploying from specific commit SHAs. This enables PR comment-based deployments where a specific commit needs to be built.

Changes

  • Add git-sha input to component-build.yml
  • Pass SHA through setup job outputs for consistency across all jobs
  • Update all checkouts and image tags to use the provided SHA
  • Add git-sha input to deploy-generic.yml, deploy-generic-v2.yml, deploy-kotlin.yml, deploy-python.yml

Usage

Calling workflows can now pass a specific SHA to build:

jobs:
  get-pr-sha:
    steps:
      - checkout PR branch
      - id: get-sha
        run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
    outputs:
      sha: ${{ steps.get-sha.outputs.sha }}
  
  deploy:
    uses: monta-app/github-workflows/.github/workflows/deploy-generic.yml@main
    with:
      git-sha: ${{ needs.get-pr-sha.outputs.sha }}
      # ... other params

Backwards compatible

The git-sha parameter is optional and defaults to github.sha, so existing workflows continue to work without changes.

@maoanran maoanran force-pushed the add-git-sha-support branch 2 times, most recently from c1b3b05 to 2d75dc9 Compare February 6, 2026 10:14
Add optional git-sha input parameter to deploy workflows to enable building and deploying from specific commit SHAs. This enables PR comment-based deployments where a specific commit needs to be built.

Changes:
- Add git-sha input to component-build.yml
- Pass SHA through setup job outputs for consistency
- Update all checkouts and image tags to use the provided SHA
- Add git-sha input to deploy-generic.yml, deploy-generic-v2.yml, deploy-kotlin.yml, deploy-python.yml
- Defaults to github.sha when not provided (backwards compatible)
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for building and deploying from specific commit SHAs by introducing an optional git-sha parameter to the build and deployment workflows. This enables PR comment-based deployments and other scenarios where a specific commit needs to be built instead of the default triggering commit.

Changes:

  • Added optional git-sha input parameter to all deployment workflows (deploy-generic, deploy-generic-v2, deploy-kotlin, deploy-python)
  • Updated component-build.yml to accept and use git-sha for checkouts, image tagging, and outputs
  • Changed Docker metadata action from automatic SHA detection to explicit raw value to ensure consistency

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/component-build.yml Added git-sha input parameter; updated all checkouts, image tags, and outputs to use the provided SHA or default to github.sha
.github/workflows/deploy-generic.yml Added git-sha input parameter and passed it through to component-build workflow
.github/workflows/deploy-generic-v2.yml Added git-sha input parameter and passed it through to component-build workflow
.github/workflows/deploy-kotlin.yml Added git-sha input parameter and passed it through to component-build workflow
.github/workflows/deploy-python.yml Added git-sha input parameter and passed it through to component-build workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maoanran maoanran merged commit 24a9e71 into main Feb 6, 2026
7 checks passed
@maoanran maoanran deleted the add-git-sha-support branch February 6, 2026 12:49
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.

2 participants