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

Testing new pull request target with label from repo user #2021

Merged
merged 9 commits into from
Oct 19, 2023

Conversation

miguelgfierro
Copy link
Collaborator

@miguelgfierro miguelgfierro commented Oct 16, 2023

Description

Related Issues

#1853

References

Checklist:

  • I have followed the contribution guidelines and code style for this project.
  • I have added tests covering my contributions.
  • I have updated the documentation accordingly.
  • This PR is being made to staging branch and not to main branch.

Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
@miguelgfierro
Copy link
Collaborator Author

miguelgfierro commented Oct 16, 2023

The tests are not executed
azureml-unit-tests / get-test-groups (pull_request_target) Skipped

azureml-unit-tests / ${{ join(matrix.*, ', ') }} (pull_request_target) Skipped

If I remove the if clause, the tests don't start either: if: github.event_name == 'pull_request' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test'))

@miguelgfierro miguelgfierro added the safe to test The PR is safe to execute the tests label Oct 16, 2023
@@ -35,7 +35,6 @@ on:
jobs:
get-test-groups:
runs-on: ubuntu-latest
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Try:

if: |
      github.event_name == 'pull_request' &&
      (github.event.pull_request.labels.*.name contains 'safe to test' || github.event.pull_request.head.repo.fork == 'false')
    steps:

@miguelgfierro miguelgfierro removed the safe to test The PR is safe to execute the tests label Oct 19, 2023
Signed-off-by: miguelgfierro <[email protected]>
@miguelgfierro miguelgfierro merged commit 7702c38 into miguel/pull_request_target Oct 19, 2023
@miguelgfierro miguelgfierro deleted the miguel/test_prt_no_fork branch October 19, 2023 10:55
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

Successfully merging this pull request may close these issues.

2 participants