Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/license_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
required: false
type: string
default: "stable"
flutter_version:
description: 'Flutter SDK version to use'
required: false
type: string
allowed:
required: false
type: string
Expand Down Expand Up @@ -51,7 +55,18 @@ jobs:
- name: 📚 Git Checkout
uses: actions/checkout@v5

- name: Check for conflicting SDK inputs
if: ${{ inputs.flutter_version != '' && inputs.dart_sdk != '' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we create a temp env variable instead so we don't repeat this code in every conditional?

Copy link
Author

@JohnWeidner JohnWeidner Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcossevilla I'm new to writing yaml files. Please show me the change with a temp env you are suggesting. Thanks.

Copy link
Member

@marcossevilla marcossevilla Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! you can check this part of the GitHub docs where you can add it as env variable with the same expression you already have

run: echo "::warning::Both 'flutter_version' and 'dart_sdk' were specified. The workflow will proceed with the Flutter SDK setup."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also validate when none were specified right?


- name: Set up Flutter
if: ${{ inputs.flutter_version != '' }}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{inputs.flutter_version}}

- name: 🎯 Setup Dart
if: ${{ inputs.flutter_version == '' }}
uses: dart-lang/setup-dart@v1
with:
sdk: ${{inputs.dart_sdk}}
Expand All @@ -64,10 +79,15 @@ jobs:
with:
ssh-private-key: ${{secrets.ssh_key}}

- name: 📦 Install Dependencies
- name: 📦 Install Dependencies for Flutter
if: ${{ inputs.flutter_version != '' }}
run: flutter pub get --no-example

- name: 📦 Install Dependencies for Dart
if: ${{ inputs.flutter_version == '' }}
run: dart pub get --no-example

- name: 👨‍⚖️ Check licenses
run: |
dart pub global activate very_good_cli
dart pub global run very_good_cli:very_good packages check licenses --skip-packages=${{inputs.skip_packages}} --dependency-type=${{inputs.dependency_type}} ${{(inputs.ignore_retrieval_failures && '--ignore-retrieval-failures') || ''}} --allowed=${{inputs.allowed}} --forbidden=${{inputs.forbidden}}
dart pub global run very_good_cli:very_good packages check licenses --skip-packages=${{inputs.skip_packages}} --dependency-type=${{inputs.dependency_type}} ${{(inputs.ignore_retrieval_failures && '--ignore-retrieval-failures') || ''}} --allowed=${{inputs.allowed}} --forbidden=${{inputs.forbidden}}