0
0
Fork 0
mirror of https://github.com/dtolnay/rust-toolchain.git synced 2025-05-29 21:53:35 +03:00

Add rustc_hash output

I.e. the `a8314ef7d` part in `rustc 1.62.0 (a8314ef7d 2022-06-27)`.
This makes it possible to use the output e.g. as a cache key.
`actions-rs/toolchain` has the same output with the same function.
This commit is contained in:
René Kijewski 2022-07-14 19:15:19 +02:00
parent f4fe19df4e
commit 6b70b4ca85

View file

@ -18,8 +18,11 @@ inputs:
outputs:
version:
description: Version as reported by `rustc --version`
description: Version as reported by `rustc --version`, e.g. "rustc 1.62.0 (a8314ef7d 2022-06-27)"
value: ${{steps.rustc-version.outputs.version}}
rustc_hash:
description: The rustc hash, e.g. "a8314ef7d"
value: ${{steps.rustc-hash.outputs.hash}}
runs:
using: composite
@ -50,5 +53,8 @@ runs:
- id: rustc-version
run: echo "::set-output name=version::$(rustc --version)"
shell: bash
- id: rustc-hash
run: echo "::set-output name=hash::$(rustc --version | cut -d'(' -f2 -| cut -d' ' -f1)"
shell: bash
- run: rustc --version
shell: bash