commits
Creates, updates, deletes, gets or lists a commits resource.
Overview
| Name | commits |
| Type | Resource |
| Id | aws.codecommit.commits |
Fields
The following fields are returned by SELECT queries:
- batch_get_commits
- get_commit
| Name | Datatype | Description |
|---|---|---|
commits | array | An array of commit data type objects, each of which contains information about a specified commit. |
errors | array | Returns any commit IDs for which information could not be found. For example, if one of the commit IDs was a shortened SHA ID or that commit was not found in the specified repository, the ID returns an error object with more information. |
| Name | Datatype | Description |
|---|---|---|
additional_data | string | Any other data associated with the specified commit. |
author | object | Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git. |
commit_id | string | The full SHA ID of the specified commit. |
committer | object | Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git. For more information about the difference between an author and a committer in Git, see Viewing the Commit History in Pro Git by Scott Chacon and Ben Straub. |
message | string | The commit message associated with the specified commit. |
parents | array | A list of parent commits for the specified commit. Each parent commit ID is the full commit ID. |
tree_id | string | Tree information for the specified commit. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_commits | select | region | Returns information about the contents of one or more commits in a repository. | |
get_commit | select | region | Returns information about a commit, including commit message and committer information. | |
create_commit | insert | region, repositoryName, branchName | Creates a commit for a repository on the tip of a specified branch. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- batch_get_commits
- get_commit
Returns information about the contents of one or more commits in a repository.
SELECT
commits,
errors
FROM aws.codecommit.commits
WHERE region = '{{ region }}' -- required
;
Returns information about a commit, including commit message and committer information.
SELECT
additional_data,
author,
commit_id,
committer,
message,
parents,
tree_id
FROM aws.codecommit.commits
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_commit
- Manifest
Creates a commit for a repository on the tip of a specified branch.
INSERT INTO aws.codecommit.commits (
repositoryName,
branchName,
parentCommitId,
authorName,
email,
commitMessage,
keepEmptyFolders,
putFiles,
deleteFiles,
setFileModes,
region
)
SELECT
'{{ repositoryName }}' /* required */,
'{{ branchName }}' /* required */,
'{{ parentCommitId }}',
'{{ authorName }}',
'{{ email }}',
'{{ commitMessage }}',
{{ keepEmptyFolders }},
'{{ putFiles }}',
'{{ deleteFiles }}',
'{{ setFileModes }}',
'{{ region }}'
RETURNING
commit_id,
files_added,
files_deleted,
files_updated,
tree_id
;
# Description fields are for documentation purposes
- name: commits
props:
- name: region
value: "{{ region }}"
description: Required parameter for the commits resource.
- name: repositoryName
value: "{{ repositoryName }}"
description: |
The name of the repository where you create the commit.
- name: branchName
value: "{{ branchName }}"
description: |
The name of the branch where you create the commit.
- name: parentCommitId
value: "{{ parentCommitId }}"
description: |
The ID of the commit that is the parent of the commit you create. Not required if this is an empty repository.
- name: authorName
value: "{{ authorName }}"
description: |
The name of the author who created the commit. This information is used as both the author and committer for the commit.
- name: email
value: "{{ email }}"
description: |
The email address of the person who created the commit.
- name: commitMessage
value: "{{ commitMessage }}"
description: |
The commit message you want to include in the commit. Commit messages are limited to 256 KB. If no message is specified, a default message is used.
- name: keepEmptyFolders
value: {{ keepEmptyFolders }}
description: |
If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If true, a ..gitkeep file is created for empty folders. The default is false.
- name: putFiles
description: |
The files to add or update in this commit.
value:
- filePath: "{{ filePath }}"
fileMode: "{{ fileMode }}"
fileContent: "{{ fileContent }}"
sourceFile:
filePath: "{{ filePath }}"
isMove: {{ isMove }}
- name: deleteFiles
description: |
The files to delete in this commit. These files still exist in earlier commits.
value:
- filePath: "{{ filePath }}"
- name: setFileModes
description: |
The file modes to update for files in this commit.
value:
- filePath: "{{ filePath }}"
fileMode: "{{ fileMode }}"