generate-supabase-db-types-github-action icon indicating copy to clipboard operation
generate-supabase-db-types-github-action copied to clipboard

Action fails when a previous type update PR has not been merged

Open alex-galey opened this issue 3 years ago • 4 comments

Action fails when a previous type update PR has not been merged

@lyqht do you have an idea or should I file an issue upstream ?

Run stefanzweifel/git-auto-commit-action@v4
Started: bash /home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/entrypoint.sh
INPUT_REPOSITORY value: .
INPUT_STATUS_OPTIONS: 
INPUT_FILE_PATTERN: db.types.ts
INPUT_BRANCH value: supabot/update-database-types
Switched to a new branch 'supabot/update-database-types'
M	db.types.ts
INPUT_ADD_OPTIONS: 
INPUT_FILE_PATTERN: db.types.ts
INPUT_COMMIT_OPTIONS: 
INPUT_COMMIT_USER_NAME: Supabot
INPUT_COMMIT_USER_EMAIL: github-actions[bot]@users.noreply.github.com
INPUT_COMMIT_MESSAGE: Update database types
INPUT_COMMIT_AUTHOR: Supabot <github-actions[bot]@users.noreply.github.com>
[supabot/update-database-types 84ddaa6] Update database types
 1 file changed, 6 insertions(+), 6 deletions(-)
INPUT_TAGGING_MESSAGE: 
No tagging message supplied. No tag will be added.
INPUT_PUSH_OPTIONS: 
To https://github.com/***
 ! [rejected]        HEAD -> supabot/update-database-types (non-fast-forward)
error: failed to push some refs to 'https://github.com/***'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  code: 1
}
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

Note I am using the action on push events :

name: Update database types
on:
  push:
    branches: [ main ]
    paths:
      - '*.sql'

jobs:
  build:
    if: github.head_ref != 'supabot**'
    runs-on: ubuntu-latest

alex-galey avatar Sep 30 '22 22:09 alex-galey

Hello there @alex-galey , this issue existed even on the previous way of running this github action on a scheduled frequency. I believe it is because of the repo-sync/pull-request@v2 GH action doesn't override the existing PR. There's probably a way to add a new PR/ force an override of existing PR, but i haven't look into how to do it. If you would like to work on it, let me know!

lyqht avatar Oct 01 '22 02:10 lyqht

Thanks for confirming the existence of this issue.

Seems it is known (and wanted) from git-auto-commit action :

"No support for git rebase or git merge. There are many strategies on how to integrate remote upstream changes to a local repository. git-auto-commit does not want to be responsible for doing that."

I will give a try of rebasing before PR

alex-galey avatar Oct 01 '22 08:10 alex-galey

Tried couple of things but I guess we need a git specialist here ^^ https://github.com/alex-galey/generate-supabase-db-types-github-action

alex-galey avatar Oct 20 '22 19:10 alex-galey

Also tried pulling before commit without succes : https://github.com/stefanzweifel/git-auto-commit-action/issues/229

alex-galey avatar Oct 20 '22 19:10 alex-galey