Created
December 8, 2019 22:41
-
-
Save lannonbr/1055b8942d91ea0881f3c9f0519ce383 to your computer and use it in GitHub Desktop.
Do stuff only in a main repo and not forks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: push | |
name: Workflow | |
jobs: | |
work: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- id: base_check | |
name: check if repo is base | |
run: | | |
if [ "$GITHUB_REPOSITORY" = "owner/repo" ]; then | |
echo "::set-output name=base::true" | |
fi | |
- name: do stuff | |
if: steps.base_check.outputs.base == 'true' | |
run: echo 'I am not a fork!' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment