autoupdate icon indicating copy to clipboard operation
autoupdate copied to clipboard

Does not trigger github workflow after auto update merge

Open mertnacakgedigi opened this issue 2 years ago • 3 comments

Hi there, our required workflow doesn't get triggered after autoupdate. It says Expected - Waiting for status to be reported. Look at the attachment.

Screen Shot 2022-07-18 at 1 33 05 PM

Here's our autoupdate.yaml file

name: autoupdate
on:
  pull_request:
    types: [auto_merge_enabled]
jobs:
  autoupdate:
    name: autoupdate
    runs-on: ubuntu-18.04
    steps:
      - uses: docker://chinthakagodawita/autoupdate-action:v1
        id: autoupdate
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
          MERGE_CONFLICT_ACTION: 'fail'

      - run: echo 'Merge conflicts found!'
        if: ${{ steps.autoupdate.outputs.conflicted }}

      - run: echo 'No merge conflicts'
        if: ${{ !steps.autoupdate.outputs.conflicted }}

Here's our beginning of not triggered workflow yaml file if you want to see events that suppose to trigger the workflow. Any idea?

name: Build

on:
  push:
  pull_request:
    types: [opened]
jobs:
  test:
   ...
  build:

mertnacakgedigi avatar Jul 18 '22 20:07 mertnacakgedigi

@mertnacakgedigi I believe this is expected, but I discovered that you could actually use a Personal Access Token (PAT) instead of GITHUB_TOKEN which should do the trick.

Would looks something like this:

name: autoupdate
on:
  pull_request:
    types: [auto_merge_enabled]
jobs:
  autoupdate:
    name: autoupdate
    runs-on: ubuntu-18.04
    steps:
      - uses: docker://chinthakagodawita/autoupdate-action:v1
        id: autoupdate
        env:
          GITHUB_TOKEN: '${{ secrets.MY_PAT }}'
          MERGE_CONFLICT_ACTION: 'fail'

      - run: echo 'Merge conflicts found!'
        if: ${{ steps.autoupdate.outputs.conflicted }}

      - run: echo 'No merge conflicts'
        if: ${{ !steps.autoupdate.outputs.conflicted }}

I think it's still a good idea to have this issue, but instead, the README should be updated to talk about this alternative authentication token.

Julian88Tex avatar Jul 22 '22 02:07 Julian88Tex

Hm, actually maybe GITHUB_TOKEN permissions can be modified: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token

Julian88Tex avatar Jul 22 '22 03:07 Julian88Tex

Created a feature request discussion to hopefully get GitHub to make this a bit clearer: https://github.com/github-community/community/discussions/21091

Julian88Tex avatar Jul 22 '22 19:07 Julian88Tex

Thanks @Julian88Tex. We don't prefer using PAT for our organization. I'm still looking for a workaround for this.

mertnacakgedigi avatar Sep 07 '22 23:09 mertnacakgedigi

Using Personal Access Token triggers the subsequence workflows. Thanks @Julian88Tex

mertnacakgedigi avatar Sep 14 '22 20:09 mertnacakgedigi