Code Monkey home page Code Monkey logo

Comments (4)

murilogok avatar murilogok commented on August 21, 2024 1

Solved this issue (deny updating a hidden ref) with:

     with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        branch: ${{ github.head_ref }} <---- Add this
        force: true

from github-push-action.

estensen avatar estensen commented on August 21, 2024

Solved this by specifying the correct ref when checking out:

- uses: actions/checkout@v1
  with:
    ref: refs/heads/${{ github.head_ref }}

from github-push-action.

kenorb avatar kenorb commented on August 21, 2024

I think I've got the same issue.
image

My configuration is like:

  Push:
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          persist-credentials: false
          # Otherwise, you will failed to push refs to dest repo.
          fetch-depth: 0
          ref: refs/heads/${{ github.head_ref }}
      - uses: actions/download-artifact@v2
         name: MyArtifact
      - name: Commit files
        run: |
          git config --local core.autocrlf false
          git config --local user.email $git_email
          git config --local user.name "${{ github.actor }}"
          git add . && git add --renormalize .
          git pull origin "${{ github.ref }}" --autostash --rebase -Xours
          git commit -am "${{ github.workflow }}"
        env:
          git_email: "${{ github.actor }}@users.noreply.github.com"
      - name: Push changes (not PR)
        if: github.event_name != 'pull_request'
        uses: ad-m/github-push-action@master
        with:
          branch: ${{ github.ref }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
      - name: Push changes (PR)
        if: github.event_name == 'pull_request'
        uses: ad-m/github-push-action@master
        with:
          branch: refs/heads/${{ github.head_ref }}
          github_token: ${{ secrets.GITHUB_TOKEN }}

Specifying ref: refs/heads/${{ github.head_ref }} as suggested didn't help.

from github-push-action.

kenorb avatar kenorb commented on August 21, 2024

Related:

from github-push-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.