Skip to content
Permalink
Browse files
fix: fixed code change detection when using modules (#1264)
* fix code change checking when using modules

* make repo and path args optional

* add error message

* validate single commit
  • Loading branch information
johanneskoester committed Nov 17, 2021
1 parent 01d6102 commit b571e09ce452f6a1a95395e1c3c8b9e3f83867ad
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
@@ -13,4 +13,6 @@ jobs:
steps:
- uses: amannn/action-semantic-pull-request@v3.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
@@ -244,13 +244,15 @@ def outputs_older_than_script_or_notebook(self):
return
if self.rule.basedir:
# needed if rule is included from another subdirectory
path = os.path.relpath(os.path.join(self.rule.basedir, path))
assert os.path.exists(path), "cannot find {0}".format(path)
script_mtime = os.lstat(path).st_mtime
for f in self.expanded_output:
if f.exists:
if not f.is_newer(script_mtime):
yield f
path = self.rule.basedir.join(path).get_path_or_uri()
if is_local_file(path):
assert os.path.exists(path), "cannot find {0}".format(path)
script_mtime = os.lstat(path).st_mtime
for f in self.expanded_output:
if f.exists:
if not f.is_newer(script_mtime):
yield f
# TODO also handle remote file case here.

@property
def threads(self):
@@ -150,12 +150,14 @@ class HostingProviderFile(SourceFile):

def __init__(
self,
repo: str,
path: str,
repo: str = None,
path: str = None,
tag: str = None,
branch: str = None,
commit: str = None,
):
if repo is None:
raise SourceFileError("repo must be given")
if not self.__class__.valid_repo.match(repo):
raise SourceFileError(
"repo {} is not a valid repo specification (must be given as owner/name)."

0 comments on commit b571e09

Please sign in to comment.