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

how to override "source version" in github actions? #61

Open
vitek-urbanec opened this issue Mar 16, 2021 · 12 comments
Open

how to override "source version" in github actions? #61

vitek-urbanec opened this issue Mar 16, 2021 · 12 comments

Comments

@vitek-urbanec
Copy link

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!

@jayheehee
Copy link

Hey there, were you able to find a solution? I am running into the same issue.

@solarmosaic-kflorence
Copy link

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

@kimmoahokas
Copy link

Seems that PR #62 tries to address this.

@akazakou
Copy link

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>'

@ozgenbaris1
Copy link

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?

@akazakou
Copy link

akazakou commented Jul 18, 2022

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

@ozgenbaris1
Copy link

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

@akazakou
Copy link

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.

@ozgenbaris1
Copy link

ozgenbaris1 commented Jul 18, 2022

@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?

image

Also, I checked cloudwatch in order to see if codebuild job exports the logs successfully. Seems ok

@akazakou
Copy link

@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

@ozgenbaris1
Copy link

@akazakou I created the issue. Thanks

@akazakou
Copy link

The issue was resolved. And for now, it was added a lot of new features! :)

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

6 participants