Skip to content

Instantly share code, notes, and snippets.

@lannonbr
Created December 8, 2019 22:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lannonbr/1055b8942d91ea0881f3c9f0519ce383 to your computer and use it in GitHub Desktop.
Save lannonbr/1055b8942d91ea0881f3c9f0519ce383 to your computer and use it in GitHub Desktop.
Do stuff only in a main repo and not forks
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