Skip to content

Commit

Permalink
ci: Fetch full history for comparing to main
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruechert committed Feb 16, 2024
1 parent 4c15e27 commit ca8a1f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test-import.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Fetch submodules
run: git submodule update --init --checkout --remote
with:
# Pull history, needed to compare changed files
fetch-depth: 2
- name: Fetch branches and submodules
run: git fetch --all && git submodule update --init --checkout --remote
- name: Build docker images
run: docker build -t transitous . -f ci/container/Containerfile
- name: Verify that new feeds can be downloaded
Expand Down
5 changes: 3 additions & 2 deletions ci/fetch-feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
for feed in feed_dir.glob("*.json"):
subprocess.check_call(["./src/fetch.py", str(feed.absolute())])
case "merge-request":
# Find all files that were changed in the latest commit
changed_files = subprocess.check_output(
["git", "diff", "--name-only", "HEAD^1", "HEAD"]) \
.decode().splitlines()
["git", "diff", "--name-only", "origin/main", "HEAD"]) \
.decode().splitlines()

changed_feeds = [f for f in changed_files if
f.startswith("feeds/") and f.endswith(".json")]
Expand Down

0 comments on commit ca8a1f6

Please sign in to comment.