When using the GitHub integration, only the files from the git repository appear in the workspace directory. This behavior is different from using triggers where it is documented how to unshallow your git repository.
If you use triggers instead of the integration, then you do not get things such as pull requests status update and the integration UI. Both of these integrations should work the same way or the behavior should be documented.
Yup! This was something we decided to try out for the GitHub App integration.
You can still use a similar process to fully clone the repository, but you will need to pass in git credentials yourself. See https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-secrets-credentials for more details on how to pass secrets securely.
You're right that the documentation is not clear about this, I'll take an AI to update the docs.
As far as pull request support with GCB triggers - coming soon!
Thanks; yes aware of the workaround but just extra work.
Is there information on the build that will let me determine what the pull request ID is? The documented variables available return the following:
{'BRANCH_NAME': 'skydoc',
'REVISION_ID': '27a2f036d87298ad545f88fc089747bbb7f0dc4a',
'REPO_NAME': 'unspecified',
'PROJECT_ID': 'dronedeploy-code-delivery-0',
'COMMIT_SHA': '27a2f036d87298ad545f88fc089747bbb7f0dc4a',
'BUILD_ID': 'f3f0aa15-56fc-4c1c-aac9-fbd558a3ed8a',
'TAG_NAME': ''}
The SHA that is showing there is the head of the PR branch, so there doesn't appear to be a documented env variable to grab the ID. If you want to post back custom statuses to the PR, then more information is needed.
Actually, appears that the GH API only requires you to update statuses based on the SHA so this is unnecessary.
Is there any reason for trying this out- switching from a trigger to the app seems like a lot of work for very little gain if you need the history- it is also just inconsistent- I was expecting the two workspaces to be equivalent.
Most helpful comment
Is there any reason for trying this out- switching from a trigger to the app seems like a lot of work for very little gain if you need the history- it is also just inconsistent- I was expecting the two workspaces to be equivalent.