Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom sourceVersion #132

Open
maastrich opened this issue May 24, 2023 · 3 comments
Open

Allow custom sourceVersion #132

maastrich opened this issue May 24, 2023 · 3 comments

Comments

@maastrich
Copy link

maastrich commented May 24, 2023

Context

I am currently working on developing workflows for stack deployment through CodeBuild. This includes a need to terminate previous builds before initiating a new one.
To implement this, I currently list the commit SHA and passes it to the CodeBuild run to stop the previous build.

Issue

I experience functional difficulties with this workflow when rebasing the branch, as the commit tree is completely different following the rebase.

Suggested Solution

Here are my solutions propositions to override the source version.

Proposal 1

The first proposition is to simply pass a source version adhering to the AWS CodeBuild sourceVersion standard.
The proposed implementation is:

- name: Trigger build on Codebuild
  uses: aws-actions/aws-codebuild-run-build@v1
  with:
    project-name: MyProjectName
    sourceVersion: refs/pull/${{ github.event.pull_request.number }}/head # or ${{ github.ref }} or ${{ github.sha }}

Proposal 2

The second proposition is slightly different, using a sourceVersionStrategy parameter instead. The proposed implementation is:

- name: Trigger build on Codebuild
  uses: aws-actions/aws-codebuild-run-build@v1
  with:
    project-name: MyProjectName
    sourceVersionStrategy: pull_request # or branch or sha

Personal notes

I'll be happy to implement this feature if ever approved

@rstuhlmuller
Copy link

I would love to see this as well. My org requires that production builds are deployed using Github tags. I love giving my team the ability to see the codebuild logs inside of the github Actions, however it is impossible for prod since we cannot choose the tag version.

@sslankesh
Copy link

This is needed in my case as well. As the source differs based on release tag

@petteriv-nordic
Copy link
Contributor

I also needed this so took a stab at above proposal 1 and created a PR for it, #151

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

No branches or pull requests

4 participants