ad-m / github-push-action

GitHub actions to push back to repository eg. updated code
MIT License
1.21k stars 229 forks source link

Facing issues while pushing to master #71

Open yrsurya opened 3 years ago

yrsurya commented 3 years ago

! [remote rejected] master -> master (refusing to allow a GitHub App to create or update workflow .github/workflows/build.yml without workflows permission)

using PAT keys where enabled workflow but still seeing this issue Any Help would be appreciated

ad-m commented 3 years ago

Please provide your workflow file.

yrsurya commented 3 years ago

on:
  push:
    branches: [master]

jobs:
  setup-repo-from-template:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2-beta
        with: { node-version: '14', registry-url: `'xxxxx'` }
      - env: { NODE_AUTH_TOKEN: "${{ secrets.JFROG_NPM_PUBLISH_AUTH }}" }
        run: chmod a+x ./init.sh && ./init.sh
      - name: Commit files
        run: |
          git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
          git config --local user.name "$GITHUB_ACTOR"
          git add .
          git status
          git commit -a -m "Initialize new repository from template"
          git push https://${{ secrets.GH_TOKEN_TEST }}@github.com/org/repoi.git
      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GH_TOKEN_TEST }}
          branch: ${{ github.ref }}
ad-m commented 3 years ago

Let's try:


on:
  push:
    branches: [master]

jobs:
  setup-repo-from-template:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-node@v2-beta
        with: { node-version: '14', registry-url: `'xxxxx'` }
      - env: { NODE_AUTH_TOKEN: "${{ secrets.JFROG_NPM_PUBLISH_AUTH }}" }
        run: chmod a+x ./init.sh && ./init.sh
      - name: Commit files
        run: |
          git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
          git config --local user.name "$GITHUB_ACTOR"
          git add .
          git status
          git commit -a -m "Initialize new repository from template"
          git push https://${{ secrets.GH_TOKEN_TEST }}@github.com/org/repoi.git
      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GH_TOKEN_TEST }}
          branch: ${{ github.ref }}
yrsurya commented 3 years ago

Error: Process completed with exit code 128.

Got this error while git push

EleanorHaproff commented 3 years ago

I just ran into this issue (not on master specifically) and changed the last line branch: ${{ github.ref }} to branch: ${{ github.head_ref }} and it fixed it