Skip to content

Prevent Update Notebook dts action from triggering on forked repositories #2871

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

Merged
merged 4 commits into from
Aug 6, 2020
Merged

Prevent Update Notebook dts action from triggering on forked repositories #2871

merged 4 commits into from
Aug 6, 2020

Conversation

corbob
Copy link
Contributor

@corbob corbob commented Aug 6, 2020

Similar to PowerShell/PowerShell#12763

PR Summary

Update GitHub Actions Workflow to only trigger on the main vscode-powershell repository.

Note: I have not tested this, merely modeled it after the documentation and the PowerShell PR.

PR Checklist

  • PR has a meaningful title
  • Summarized changes
  • [NA] PR has tests
  • This PR is ready to merge and is not work in progress

@TylerLeonhardt
Copy link
Member

I was kinda hoping this would prevent the entire action from running. In the other PR the if is at a higher level.

Can you follow that?

corbob added 2 commits August 6, 2020 11:11
Put the check in the overall definition so none of the workflow runs if not the main repository.
@corbob
Copy link
Contributor Author

corbob commented Aug 6, 2020

I've moved the if up to the steps level. I tried it in the on level, but it didn't like that. I also added it to the codeql workflow so it too only runs on the main repository. From my testing it works:
image

Edit for completeness: I configured the schedule in my master branch to run every 10 minutes, and it was skipped:
image

This means that actions will be showing up in forked repos, but they won't run... I guess that's about the best we can do 🤷

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM thanks @corbob !

@TylerLeonhardt TylerLeonhardt merged commit b1139e5 into PowerShell:master Aug 6, 2020
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