Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action might not be waiting for right commit #77

Open
Cameronsplaze opened this issue Jun 22, 2021 · 3 comments
Open

Action might not be waiting for right commit #77

Cameronsplaze opened this issue Jun 22, 2021 · 3 comments

Comments

@Cameronsplaze
Copy link

Cameronsplaze commented Jun 22, 2021

We have three branches in our normal workflow, devel -> test -> prod.
Other branches exist, (for me, branch 'cameron'), and I'm writing an workflow that if 'cameron' has a pr directly to prod, it'll open pr's to devel/test first. I need to wait for test to pass, and only if 'test' branch passes, pass the prod PR. (That's where I'm using this action).

RIght now, in your action debug, it's waiting for the last time test was merged to prod, NOT the pr that's open from cameron to prod (the pr that triggered the action). Am I doing something wrong? Is there a way to tell your action to wait for a specific commit? It's finding a commit, but not able to find any status's of the commit, so it skips/passes itself.

The action is here https://github.com/asfadmin/Discovery-WKTUtils/pull/315/checks?check_run_id=2889412835. It runs your action twice, both times looking for commit 2cda8ab4ad88821cc7c6e7b351b62b58303b8827. If you look at the commits, that commit was the last time test was merged into prod, NOT the PR that is cameron into prod, which is the PR that triggers the action (should be d357597ff7b03a500e00583df801ae13b278ec9e I think?).

Any idea what might be going on here? I'm confused. Thanks a ton in advance!

@Cameronsplaze
Copy link
Author

I'm not sure how much info to give in an issue lol. If there's too much there to go through, I'm down to create a repo with a minimal example too.

@WyriHaximus
Copy link
Owner

Hey @Cameronsplaze will have a look this week. The link you gave me should be enough context I need to look at this 👍 .

@Cameronsplaze
Copy link
Author

I noticed something that might be related to this? Both the example above, and a smaller action on my private repo have been showing this message in the output of running this action:

2021-06-22 21:44:47.937152] wait.WARNING: No statuses found, assuming success

My private repo is a much smaller example, so just in case this helps too.

name: Automerge labeled PR

on:
  pull_request:
    types:
      - opened
      - reopened
      - labeled
      - unlabeled
      - edited
      - synchronize

jobs:
  automerge:
    if: contains(github.event.pull_request.labels.*.name, 'auto merge')
    runs-on: ubuntu-latest
    steps:
    
      - name: 'Wait for action suite'
        uses: "WyriHaximus/[email protected]"
        id: waitforstatuschecks
        with:
          checkInterval: 10
          ignoreActions: "automerge"
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

      # If something in the suite FAILED, break off now:
      - name: 'Check success of action suite'
        run: "[[ \"${{ steps.waitforstatuschecks.outputs.status }}\" == 'success' ]]"

      # Finally merge the PR:
      - name: 'Merge to Branch'
        uses: "pascalgn/[email protected]"
        env:
          GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
          MERGE_LABELS: auto merge
          UPDATE_LABELS: auto merge

It might be a stretch, but maybe it's not finding anything because GitHub changed a hook or something? I think the first example I posted used to work, but stopped without me even changing the pin a while back. If this is really what's going on, what do you think of some flag that makes the action fail if it can't find anything? So that it'd flag someone to review it I mean.

Just a thought. Hopefully this proves useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants