From b6a0604e1999fab34e072e846aae56f5de2abed5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 25 Sep 2022 07:54:59 -0700 Subject: [PATCH] Make sure the 'ago' syntax specifies 'stable' --- .github/workflows/ci.yml | 6 +++--- README.md | 2 +- action.yml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 379ce63..f5159ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: matrix: name: [Linux] os: [ubuntu] - rust: [nightly, beta, stable, 1.62.0, 1.0.0, 18 months ago, stable minus 8 releases] + rust: [nightly, beta, stable, 1.62.0, 1.0.0, stable 18 months ago, stable minus 8 releases] include: - name: macOS os: macos @@ -28,7 +28,7 @@ jobs: rust: 1.62.0 - name: macOS os: macos - rust: 18 months ago + rust: stable 18 months ago - name: macOS os: macos rust: stable minus 8 releases @@ -40,7 +40,7 @@ jobs: rust: 1.62.0 - name: Windows os: windows - rust: 18 months ago + rust: stable 18 months ago - name: Windows os: windows rust: stable minus 8 releases diff --git a/README.md b/README.md index a04a49b..6ec4744 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ compiler support. # offset, which may be written in years, months, weeks, or days. - uses: dtolnay/rust-toolchain@master with: - toolchain: 18 months ago + toolchain: stable 18 months ago ``` ```yaml diff --git a/action.yml b/action.yml index cc7f9cc..aa1928a 100644 --- a/action.yml +++ b/action.yml @@ -30,11 +30,11 @@ runs: - id: parse run: | : parse toolchain version - if [[ $toolchain =~ ^[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then + if [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then if [[ ${{runner.os}} == macOS ]]; then - echo "::set-output name=toolchain::1.$((($(date -v-$(sed 's/\([0-9]*\) \(.\).*/\1\2/' <<< $toolchain) +%s)/60/60/24-16569)/7/6))" + echo "::set-output name=toolchain::1.$((($(date -v-$(sed 's/stable \([0-9]*\) \(.\).*/\1\2/' <<< $toolchain) +%s)/60/60/24-16569)/7/6))" else - echo "::set-output name=toolchain::1.$((($(date --date "$toolchain" +%s)/60/60/24-16569)/7/6))" + echo "::set-output name=toolchain::1.$((($(date --date "${toolchain#stable }" +%s)/60/60/24-16569)/7/6))" fi elif [[ $toolchain =~ ^stable' 'minus' '[0-9]+' 'releases?$ ]]; then echo "::set-output name=toolchain::1.$((($(date +%s)/60/60/24-16569)/7/6-${toolchain//[^0-9]/}))"