Skip to content

Commit

Permalink
add workflow-tester98
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeFalourd committed May 22, 2024
1 parent f1a8871 commit 45ac95a
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/workflow-tester98-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test 98 reusable # Related to SO https://stackoverflow.com/questions/78513070/how-to-send-variables-to-called-workflow-from-the-caller-workflow/78514014?noredirect=1#comment138421206_78514014

on:
workflow_dispatch:
inputs:
cacheName:
type: string
description: 'Provide Cache Name'
expirationType:
type: choice
options:
- timeoutInSec
- timeOfDay
- date
expirationTime:
type: string
description: 'Provide Expiration Time in Secods'
workflow_call:
inputs:
cacheName:
type: string
description: 'Provide Cache Name'
expirationType:
type: string
expirationTime:
type: string
description: 'Provide Expiration Time in Secods'

jobs:
Create_Update-Cache:
runs-on: [ubuntu-latest]
steps:
- name: Do something
run: |
echo ${{ inputs.cacheName }}
echo ${{ inputs.expirationType }}
echo ${{ inputs.expirationTime }}.
34 changes: 34 additions & 0 deletions .github/workflows/workflow-tester98.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test 98 # Related to SO https://stackoverflow.com/questions/78513070/how-to-send-variables-to-called-workflow-from-the-caller-workflow/78514014?noredirect=1#comment138421206_78514014

on:
workflow_dispatch:

jobs:
build:
runs-on: [ubuntu-latest]
outputs:
iterations: ${{ steps.set-iterations.outputs.values }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read CSV and trigger workflows
id: set-iterations
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo Saving iteration list output
echo "values=[{"cacheName":"iteration1", "expirationType":"iteration1", "expirationTime":"iteration1"},{"cacheName":"iteration2", "expirationType":"iteration2", "expirationTime":"iteration2"},{"cacheName":"iteration3", "expirationType":"iteration3", "expirationTime":"iteration3"}"]" >> $GITHUB_OUTPUT
call-ASGW-Config-Cache:
needs: [build]
strategy:
matrix:
iteration: ${{fromJson(needs.build.outputs.iterarions)}}
uses: ./.github/workflows/workflow-tester98-reusable.yml
secrets: inherit
permissions:
contents: read
with:
cacheName: ${{ matrix.iteration.cacheName }}
expirationType: ${{ matrix.iteration.expirationType }}
expirationTime: ${{ matrix.iteration.expirationTime }}

0 comments on commit 45ac95a

Please sign in to comment.