From 99d214c44fea9cf16ccde1d1e50ffe3d1127f3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bobot?= Date: Tue, 21 May 2024 15:02:38 +0200 Subject: [PATCH] [CI] checkout fork in specififc directory --- .github/workflows/comment.yml | 8 +++++++- smtcomp/main.py | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/comment.yml b/.github/workflows/comment.yml index 92f5f7bc..f1fa19c7 100644 --- a/.github/workflows/comment.yml +++ b/.github/workflows/comment.yml @@ -27,9 +27,15 @@ jobs: files: | submissions/*.json + - uses: actions/checkout@v3 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + path: "fork" + - name: Show changed files run: | - poetry run smtcomp show --into-comment-file comment.md ${{ steps.changed-files.outputs.all_changed_files }} + poetry run smtcomp show --into-comment-file comment.md --prefix fork/ ${{ steps.changed-files.outputs.all_changed_files }} - name: PR comment with file uses: thollander/actions-comment-pull-request@v2 diff --git a/smtcomp/main.py b/smtcomp/main.py index 7a588d7f..7cccf528 100644 --- a/smtcomp/main.py +++ b/smtcomp/main.py @@ -34,11 +34,15 @@ @app.command() def show( files: list[Path] = typer.Argument(None), + prefix: Optional[Path] = None, into_comment_file: Annotated[Optional[Path], typer.Option(help="Write the summary into the given file")] = None, ) -> None: """ Show information about a solver submission """ + + if prefix is not None: + files = list(map(prefix.joinpath,files)) def read_submission(file: Path) -> defs.Submission: try: