Skip to content

Commit

Permalink
enhance set output
Browse files Browse the repository at this point in the history
  • Loading branch information
Alif Rachmawadi committed Sep 8, 2022
1 parent 1e95277 commit de3cdb9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ jobs:
channel: [stable, beta, master]
steps:
- uses: actions/checkout@v3
- uses: ./
- id: flutter-action
uses: ./
with:
channel: ${{ matrix.channel }}
- name: Echo outputs
run: |
echo cache-path=${{ steps.flutter-action.outputs.cache-path }}
echo cache-key=${{ steps.flutter-action.outputs.cache-key }}
echo channel=${{ steps.flutter-action.outputs.channel }}
echo version=${{ steps.flutter-action.outputs.version }}
echo architecture=${{ steps.flutter-action.outputs.architecture }}
shell: bash
- run: dart --version
shell: bash
- run: flutter --version
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,21 @@ Note: `cache-key` and `cache-path` has support for several dynamic values:
- `:arch:`
- `:hash:`
- `:sha256:`

Use outputs from `flutter-action`:

```yaml
steps:
- uses: actions/checkout@v3
- id: flutter-action
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: |
echo cache-path=${{ steps.flutter-action.outputs.cache-path }}
echo cache-key=${{ steps.flutter-action.outputs.cache-key }}
echo channel=${{ steps.flutter-action.outputs.channel }}
echo version=${{ steps.flutter-action.outputs.version }}
echo architecture=${{ steps.flutter-action.outputs.architecture }}
shell: bash
```
11 changes: 11 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ inputs:
description: 'The architecture of Flutter SDK executable (x64 or arm64)'
required: false
default: '${{ runner.arch }}'
outputs:
cache-path:
value: '${{ steps.flutter-action.outputs.cache-path }}'
cache-key:
value: '${{ steps.flutter-action.outputs.cache-key }}'
channel:
value: '${{ steps.flutter-action.outputs.channel }}'
version:
value: '${{ steps.flutter-action.outputs.version }}'
architecture:
value: '${{ steps.flutter-action.outputs.architecture }}'
runs:
using: 'composite'
steps:
Expand Down

0 comments on commit de3cdb9

Please sign in to comment.