Push to origin from GitHub action

actions/checkout@v2 Version 2 of checkout resolves the detached HEAD state issue and simplifies pushing to origin. name: Push commit on: push jobs: report: runs-on: ubuntu-latest steps: – uses: actions/checkout@v2 – name: Create report file run: date +%s > report.txt – name: Commit report run: | git config –global user.name ‘Your Name’ git config –global user.email … Read more

How to get the current branch within Github Actions?

I added a separate step for extracting branch name from $GITHUB_REF and set it to the step output – name: Extract branch name shell: bash run: echo “##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})” id: extract_branch after that, I can use it in the next steps with – name: Push to ECR id: ecr uses: jwalton/gh-ecr-push@master with: access-key-id: ${{ … Read more