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

Fix E2E tests for forks #892

Merged
merged 2 commits into from
Oct 28, 2024
Merged

Fix E2E tests for forks #892

merged 2 commits into from
Oct 28, 2024

Conversation

mvitale1989
Copy link
Member

@mvitale1989 mvitale1989 commented Oct 28, 2024

Summary

Fix conditional for not logging into dockerhub when running on forks:

  • Explicitly state which repository the E2E test should run for
  • Remove quotes around if condition

I'll double check that this works and then mark this as ready-for-review

@@ -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'
Copy link
Collaborator

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?

Copy link
Member Author

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

Copy link
Member Author

@mvitale1989 mvitale1989 Oct 28, 2024

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:

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

Copy link
Collaborator

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 🙌

@mvitale1989 mvitale1989 marked this pull request as ready for review October 28, 2024 15:35
@streamer45 streamer45 added the 3: Reviews Complete All reviewers have approved the pull request label Oct 28, 2024
@mvitale1989 mvitale1989 merged commit 7134b75 into main Oct 28, 2024
19 checks passed
@mvitale1989 mvitale1989 deleted the fix-e2e-for-forks branch October 28, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants