Skip to content

Commit

Permalink
add random generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Kislovskiy committed Apr 13, 2024
1 parent 3a20376 commit afaaff2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/2024_PyConDE_random_generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Random Number Workflow
run-name: "MANUAL - 🔬 Show Default Env (run by - ${{ github.triggering_actor }})"

on:
workflow_dispatch:
pull_request:

jobs:
random-number-generator:
runs-on: ubuntu-latest
outputs:
number: ${{ steps.generate-number.outputs.number }}
is-even: ${{ steps.generate-number.outputs.is-even }}
steps:
- id: generate-number
run: echo "number=$((RANDOM))" >> $GITHUB_ENV
- id: is-even
run: |
echo "is-even=$(( ${{ steps.generate-number.outputs.number }} % 2 == 0 ))" >> $GITHUB_ENV
echo "The number is ${{ steps.generate-number.outputs.number }}" >> $GITHUB_ENV
consumer-of-generator-odd:
needs: random-number-generator
runs-on: ubuntu-latest
if: ${{ needs.random-number-generator.outputs.is-even == 'false' }}
steps:
- run: echo "The number is ${{ needs.random-number-generator.outputs.number }} is odd"

0 comments on commit afaaff2

Please sign in to comment.