Skip to content

Make branch optional #27

@yelizariev

Description

@yelizariev

Is your feature request related to a problem? Please describe.

I mainly use the action to compile code (e.g. rst to html). Which happens in PR branches on pushing, not in pull request. Currently, I either need to hardcode branch (e.g. master), or add an extra step like following:

    - run: |
        BRANCH="${GITHUB_REF:11}"
        echo "::set-env name=BRANCH::$BRANCH"
    - name: Commit changes
      uses: stefanzweifel/[email protected]
      with:
        branch: ${{ env.BRANCH }}

Describe the solution you'd like

When not set, the branch should be computed. It could be something like this;

BRANCH=${INPUT_BRANCH}
if [[ -z "$INPUT_BRANCH ]]
then
    BRANCH=${GITHUB_REF:11}
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions