Get Commits

Fetch the list of commits for a specified GitHub repository.

Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

get the commits from {the repository source} [whose condition]

Fetch the list of commits for a specified GitHub repository.

Base Syntax

get the commits from {the repository source}

  • What does it do? This is the base syntax for the procedure.

  • Where does it go? This phrase should be written on a new line.

  • Is it required? ✅ Yes — This part of the phrase is required.

  • Does it require input data? ✅ Yes — This phrase requires a value for the repository source.

  • Example (the repository source): "kognitos/bdk-api"

Filter Condition Syntax

whose [condition]

  • What does it do? This is an optional clause used to specify a condition for filtering.

  • Where does it go? If used, this clause immediately follows the get the commits from {the repository source} phrase on the same line.

  • Is it required? 🌟 No — This clause is optional in the syntax.

  • Does it require input data? ✅ Yes — This clause requires a condition (a filter expression) to be specified.

the branch is

What does it do? Specifies the branch to fetch commits from. Defaults to 'main'.

Where does it go? This phrase should be indented beneath get the commits from {the repository source}

Is it required? 🌟 No — This phrase is optional in the syntax.

Does it require input data? ✅ Yes — a text value needs to be specified.

Example: the branch is "text example"

Default: 'main'

the offset is

What does it do? Specifies the number of commits to skip. Defaults to 0.

Where does it go? This phrase should be indented beneath get the commits from {the repository source}

Is it required? 🌟 No — This phrase is optional in the syntax.

Does it require input data? ✅ Yes — a number value needs to be specified.

Example: the offset is 123

Default: 0

the limit is

What does it do? Specifies the number of commits to fetch. Defaults to 50.

Where does it go? This phrase should be indented beneath get the commits from {the repository source}

Is it required? 🌟 No — This phrase is optional in the syntax.

Does it require input data? ✅ Yes — a number value needs to be specified.

Example: the limit is 123

Default: 50

Examples

1. Retrieve the list of commits from the main branch of a repository

get some commits from "kognitos/bdk-api"

2. Retrieve the list of commits from a specific branch of a repository

get some commits from "kognitos/bdk-api" with
        the branch is "develop"

3. Retrieve the list of commits filtered by the date in which they were committed

convert "2024-08-20T15:00:00Z" to a datetime
use the above as the commit date
get the list of commits from "kognitos/bdk-api" whose date commited is the commit date

4. Retrieve the list of commits that were committed in the specified time period

convert "2024-08-13T15:00:00Z" to a datetime
use the above as the start date
convert "2024-08-20T15:00:00Z" to a datetime
use the above as the end date
get the list of commits from "kognitos/bdk-api" whose date commited is after the start date and whose date commited is before the end date

Last updated

Was this helpful?