GitHub Action — Get the Content of a Key from pubspec.yaml in a Flutter App

This GitHub Action (written in composite run steps) allows you to leverage GitHub Actions to get the Flutter pubspec file and get content of a root key.



Create a workflow .yml file in your .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.


For more information on this input, see the Workflow syntax for GitHub Actions

  • pubspec-file-path: The pubspec.yaml file path. Optional. Default: pubspec.yaml
  • key: The key to look at. Optional. Default: version


For more information on this output, see the Workflow syntax for GitHub Actions and the Context and expression syntax for GitHub Actions

  • key: The content and the key that you search, this name depends of the key you search

Common workflow

Example if you search the key ‘version’:

on: push

name: Sample Workflow

    name: Example
    runs-on: ubuntu-latest
      - name: Checkout code
        uses: actions/[email protected]
      - name: Get App version
        id: app-version
        uses: alvarogabrielgomez/[email protected]
      - run: echo "The content of the 'version' key is ${{ }}."


A special mention goes to @zgosalvez, who create the initial solution of search a key at github-actions-get-flutter-version-env. I only extend the idea to search another keys.


The scripts and documentation in this project are released under the MIT License


View Github