aws-codebuild-run-build
                                
                                 aws-codebuild-run-build copied to clipboard
                                
                                    aws-codebuild-run-build copied to clipboard
                            
                            
                            
                        Allow custom sourceVersion
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
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.
This is needed in my case as well. As the source differs based on release tag
I also needed this so took a stab at above proposal 1 and created a PR for it, #151