Skip to content

Fix action run on base branch#27860

Merged
Abacn merged 3 commits intoapache:masterfrom
Abacn:fixaction
Aug 7, 2023
Merged

Fix action run on base branch#27860
Abacn merged 3 commits intoapache:masterfrom
Abacn:fixaction

Conversation

@Abacn
Copy link
Copy Markdown
Contributor

@Abacn Abacn commented Aug 4, 2023

Fixes #27854

example run:

it appears there is still an issue in the pull request trigger. Once triggered, it will abort the push or schedule run on master branch

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@Abacn
Copy link
Copy Markdown
Contributor Author

Abacn commented Aug 4, 2023

R: @andreydevyatkin @damccorm

@Abacn
Copy link
Copy Markdown
Contributor Author

Abacn commented Aug 4, 2023

It fails on this PR due to inconsistent setup-action.yml run between setup (yml on master) and post setup (yml been overwritten). This is actually the same direct cause of #27854 a github action issue

@github-actions github-actions bot added the build label Aug 4, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 4, 2023

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
with:
ref: ${{ github.event.pull_request.head.sha }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, for push/schedule/workflow_dispatch, we probably don't even need this checkout, do we?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the pull_request event doesn't really make sense and we've already done the checkout previously to get access to this action

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Abacn Abacn merged commit 347f84c into apache:master Aug 7, 2023
@Abacn Abacn deleted the fixaction branch August 7, 2023 17:07
@damccorm
Copy link
Copy Markdown
Contributor

damccorm commented Aug 8, 2023

@damccorm
Copy link
Copy Markdown
Contributor

damccorm commented Aug 8, 2023

Actually, that may just be because there were merge conflicts in the PR #27893

@Abacn
Copy link
Copy Markdown
Contributor Author

Abacn commented Aug 8, 2023

I see, when there is a merge conflict, the ref refs/pull/<PR number>/merge is then not available. One fix could be changing

with:
        ref: refs/pull/${{ github.event.issue.number }}/merge

to

run: |
    git checkout refs/pull/${{ github.event.issue.number }}/merge || git checkout refs/pull/${{ github.event.issue.number }}/head

then it falls back to the pull request branch head if there is merge conflicts, which is the current Jenkins behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: GitHub Action on PR of old base would fail

2 participants