-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fix E2E tests for forks #892
Conversation
.github/workflows/e2e.yml
Outdated
@@ -158,7 +158,7 @@ jobs: | |||
- name: e2e/docker-login | |||
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 | |||
# Do not authenticate on Forks | |||
if: "github.event.repository.full_name == github.repository" | |||
if: github.event.repository.full_name == 'mattermost/mattermost-plugin-calls' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the real problem the quotes then? I'd still expect github.repository
to match mattermost/mattermost-plugin-calls
in non forks right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Github Actions linter in VScode marked the quotes as a problem, so yes they may indeed be.
I am running a some tests in another repository to be sure about the root cause, before marking this PR as ready4review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some testing, it turns out that the event origin is the target repo instead of the fork, even in the pull_request
event. Here are the test results:
- PR, not from fork: https://github.com/mattermost/test-public-project/actions/runs/11556816926/job/32165381940?pr=23
- PR, from fork: https://github.com/mattermost/test-public-project/actions/runs/11556888244/job/32165619193?pr=25#step:2:12
- From local branch push: https://github.com/mattermost/test-public-project/actions/runs/11557170713/job/32166562102#step:2:11
The condition I used is "! github.event.pull_request.head.repo.fork"
, which is the one you originally used and works perfectly fine even with the non-PR triggers 😅
I have adapted this PR accordingly, sorry for the disruption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah...cool, thanks for checking all that 🙌
Summary
Fix conditional for not logging into dockerhub when running on forks:
if
conditionI'll double check that this works and then mark this as ready-for-review