how to override "source version" in github actions?
Hello,
What I'd like to have is a workflow in github actions that triggers for every branch on push (defined in a workflow in master default branch).
This workflow should trigger aws-codebuild-run-build action & the codebuild project should download source from a branch some_branch.
If I understood correctly, aws-codebuild-run-build overrides the source version to the triggering commit, regardless of the settings in the codebuild project.
How do I make sure that codebuild is going to get source from the specified branch some_branch?
Thanks!
Hey there, were you able to find a solution? I am running into the same issue.
This action should support all of the source version syntax as specified by https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html
Seems that PR https://github.com/aws-actions/aws-codebuild-run-build/pull/62 tries to address this.
Probably you can use dark-mechanicum/aws-codebuild@v1 action to implement what you need.
name: Running example
on: [push]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
jobs:
deploy:
name: 'Deployment'
runs-on: ubuntu-latest
steps:
- name: Executing AWS CodeBuild task
uses: dark-mechanicum/aws-codebuild@v1
env:
CODEBUILD__sourceVersion: "my-cool-branch-name"
with:
projectName: '<your-aws-codebuild-job-name-here>'
Hey @akazakou!
As far as I understand, this action doesn't wait for the final result of the codebuild project. It only triggers the project and proceeds to the next github action step. Am I right?
@ozgenbaris1 is waiting for results and showing logs in GitHub actions logs output. :) Please, check that in your CodeBuild Job logs settings you have enabled the checkbox to enable CloudWatch logs. Parameters of log group and prefix (stream) can be empty.
Is there an additional config that I'm missing out? Once the step starts, the only log I'm getting is below. It lasts 0 seconds
CodeBuild project job project_name:some-id was started successful.
would appreciate if you can help
CodeBuild project job project_name:some-id was started successful.
@ozgenbaris1 Is that the exact log or did you just replace it?
Please, check that in your CodeBuild Job logs settings you have enabled the checkbox to enable CloudWatch logs. Parameters of log group and prefix (stream) can be empty.
@akazakou
Is that the exact log or did you just replace it?
The bold parts are just placeholders. Other parts are exact logs.
Please, check that in your CodeBuild Job logs settings you have enabled the checkbox to enable CloudWatch logs. Parameters of log group and prefix (stream) can be empty.
If you are talking about the image below, it seems it is already enabled. What else can I check?

Also, I checked cloudwatch in order to see if codebuild job exports the logs successfully. Seems ok
@ozgenbaris1 Yes. I'm talking about that option. Could you please provide me with the whole output for that GitHub action?
And yes, please create an issue in action repository https://github.com/dark-mechanicum/aws-codebuild/issues/new Let's move discussion there
@akazakou I created the issue. Thanks
The issue was resolved. And for now, it was added a lot of new features! :)