How to pass the output of a bash command to Github Action parameter

Now that set-env is deprecated you can use set-output to accomplish the same thing in this answer

- name: Retrieve version
  run: |
    echo "::set-output name=TAG_NAME::$(cat projectFile | grep -Po '(?<=Version>).*(?=</Version>)')"
  id: version

- name: Create Release
  id: create_release
  uses: actions/create-release@v1
    GITHUB_TOKEN: ${{ secrets.token }}
    tag_name: ${{ steps.version.outputs.TAG_NAME }}


How to save the output of a bash command to output parameter in github actions

Use environment files

  - name: Set the value
    id: step_one
    run: |
        echo "FOO=$(git status)" >> $GITHUB_ENV
  - name: Use the value
    id: step_two
    run: |
        echo "${{ env.FOO }}"