Skip to content

Commit

Permalink
fix(nightly): fetch two commits to detect commits-since-last-build
Browse files Browse the repository at this point in the history
The default behavior for GitHub's `actions/checkout@v2` only fetches the
latest commit [1], so our previous attempts to detect commits "since
last night's nightly build" always failed.  Fetch two commits to make it
possible to detect commits in `main` within the past 25 hours.

[1] https://github.com/actions/checkout/tree/25a956c84d5dd820d28caab9f86b8d183aeeff3d#checkout-v2
  • Loading branch information
sjbarag committed Apr 9, 2021
1 parent 6dd52c1 commit b623d8b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/nightly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
publish: {
runs-on: "ubuntu-latest",
steps: [
{ uses: "actions/checkout@v2" },
{
uses: "actions/checkout@v2",
with: {
fetch-depth: 2
}
},
{
id: "commits_since_last_nightly",
name: "Check for commits since last night's build",
run: "test -n \"$(git log --oneline --since '25 hours ago')\"",
"continue-on-error": true
continue-on-error: true
},
{
name: "Set up node 12",
Expand Down

0 comments on commit b623d8b

Please sign in to comment.