Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix linting
  • Loading branch information
EnricoMi committed Aug 14, 2025
commit 6e45ce3ca705f727a7de55ee6981f7b56386df78
18 changes: 12 additions & 6 deletions github/SelfHostedActionsRunnerToken.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@

from __future__ import annotations

from typing import Any
from datetime import datetime, timezone
from typing import TYPE_CHECKING, Any

from black import datetime

from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
import github.Repository
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet

if TYPE_CHECKING:
from github.Repository import Repository


class SelfHostedActionsRunnerToken(NonCompletableGithubObject):
Expand All @@ -42,7 +46,7 @@ class SelfHostedActionsRunnerToken(NonCompletableGithubObject):
"""

def _initAttributes(self) -> None:
self._expires_at: Attribute[str] = NotSet
self._expires_at: Attribute[datetime] = NotSet
self._permissions: Attribute[dict[str, Any]] = NotSet
self._repositories: Attribute[list[Repository]] = NotSet
self._repository_selection: Attribute[str] = NotSet
Expand All @@ -53,7 +57,7 @@ def __repr__(self) -> str:
return self.get__repr__({"token": self._token.value})

@property
def expires_at(self) -> str:
def expires_at(self) -> datetime:
return self._expires_at.value

@property
Expand Down Expand Up @@ -82,7 +86,9 @@ def _useAttributes(self, attributes: dict[str, Any]) -> None:
if "permissions" in attributes: # pragma no branch
self._permissions = self._makeDictAttribute(attributes["permissions"])
if "repositories" in attributes: # pragma no branch
self._repositories = self._makeListOfClassesAttribute(github.Repository.Repository, attributes["repositories"])
self._repositories = self._makeListOfClassesAttribute(
github.Repository.Repository, attributes["repositories"]
)
if "repository_selection" in attributes: # pragma no branch
self._repository_selection = self._makeStringAttribute(attributes["repository_selection"])
if "single_file" in attributes: # pragma no branch
Expand Down
Loading