Skip to content

Commit 2e4fc08

Browse files
authored
Merge pull request dtolnay#32 from dtolnay/ago
Make sure the 'ago' syntax specifies 'stable'
2 parents ebab191 + b6a0604 commit 2e4fc08

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
matrix:
1919
name: [Linux]
2020
os: [ubuntu]
21-
rust: [nightly, beta, stable, 1.62.0, 1.0.0, 18 months ago, stable minus 8 releases]
21+
rust: [nightly, beta, stable, 1.62.0, 1.0.0, stable 18 months ago, stable minus 8 releases]
2222
include:
2323
- name: macOS
2424
os: macos
@@ -28,7 +28,7 @@ jobs:
2828
rust: 1.62.0
2929
- name: macOS
3030
os: macos
31-
rust: 18 months ago
31+
rust: stable 18 months ago
3232
- name: macOS
3333
os: macos
3434
rust: stable minus 8 releases
@@ -40,7 +40,7 @@ jobs:
4040
rust: 1.62.0
4141
- name: Windows
4242
os: windows
43-
rust: 18 months ago
43+
rust: stable 18 months ago
4444
- name: Windows
4545
os: windows
4646
rust: stable minus 8 releases

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ compiler support.
6767
# offset, which may be written in years, months, weeks, or days.
6868
- uses: dtolnay/rust-toolchain@master
6969
with:
70-
toolchain: 18 months ago
70+
toolchain: stable 18 months ago
7171
```
7272
7373
```yaml

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ runs:
3030
- id: parse
3131
run: |
3232
: parse toolchain version
33-
if [[ $toolchain =~ ^[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then
33+
if [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then
3434
if [[ ${{runner.os}} == macOS ]]; then
35-
echo "::set-output name=toolchain::1.$((($(date -v-$(sed 's/\([0-9]*\) \(.\).*/\1\2/' <<< $toolchain) +%s)/60/60/24-16569)/7/6))"
35+
echo "::set-output name=toolchain::1.$((($(date -v-$(sed 's/stable \([0-9]*\) \(.\).*/\1\2/' <<< $toolchain) +%s)/60/60/24-16569)/7/6))"
3636
else
37-
echo "::set-output name=toolchain::1.$((($(date --date "$toolchain" +%s)/60/60/24-16569)/7/6))"
37+
echo "::set-output name=toolchain::1.$((($(date --date "${toolchain#stable }" +%s)/60/60/24-16569)/7/6))"
3838
fi
3939
elif [[ $toolchain =~ ^stable' 'minus' '[0-9]+' 'releases?$ ]]; then
4040
echo "::set-output name=toolchain::1.$((($(date +%s)/60/60/24-16569)/7/6-${toolchain//[^0-9]/}))"

0 commit comments

Comments
 (0)