1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Commit
======
Create commit status check
--------------------------
.. code-block:: python
# sha -> commit on which the status check will be created
# For example, for a webhook payload
# sha = data["pull_request"]["head"]["sha"]
repo.get_commit(sha=sha).create_status(
state="pending",
target_url="https://FooCI.com",
description="FooCI is building",
context="ci/FooCI"
)
Get commit date
--------------------------
.. code-block:: python
>>> commit = repo.get_commit(sha=sha)
>>> print(commit.commit.author.date)
2018-10-11 03:04:52
>>> print(commit.commit.committer.date)
2018-10-11 03:04:52
|