Skip to content

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

Merged
TylerLeonhardt merged 4 commits intoPowerShell:masterfrom
corbob:stop-the-fork-PRs
Aug 6, 2020
Merged

Prevent Update Notebook dts action from triggering on forked repositories#2871
TylerLeonhardt merged 4 commits intoPowerShell:masterfrom
corbob:stop-the-fork-PRs

Conversation

@corbob
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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