Skip to content

Commit

Permalink
Update last modified time of unchanged files
Browse files Browse the repository at this point in the history
Set the last modified time of any files not changed on this branch to that of the last commit on the default branch. Unchanged files should then have a last modified time from before the last build of the default branch. That means we should be able to do an incremental build for only files that changed on this branch.
  • Loading branch information
DanRStevens committed Nov 18, 2024
1 parent 8b05742 commit e34b268
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ jobs:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'

steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set file modification times
shell: bash
run: |
# Use committer time from head of default branch
commitTime=$(git show --pretty=format:%ct)
# Set all file modification times to commit time
find "*" -type f -exec touch -d "$commitTime" {} \;
# When branch is checked out, any files modified on that branch will have a newer time
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
Expand Down

0 comments on commit e34b268

Please sign in to comment.