Howdo i create a random uuid from a github action? I found a third party github action that creates a random uuid but i am hoping there is some native action that already supports this scenario.
With a Linux runner you can use uuidgen:
name: Test linux job
on:
push
jobs:
testJob:
name: Test
runs-on: ubuntu-latest
steps:
- run: |
uuidgen
This will output the uuid to the console. You can then redirect the output to a file or a variable with the standard shell mechanisms.
as an improvement to the answer from @riQQ
name: Test linux job
on:
push
jobs:
testJob:
name: Test
runs-on: ubuntu-latest
steps:
- name: Get uuid
id: uuid
run: |
echo "::set-output name=uuid::$(uuidgen)"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With