Only run the GitHub Actions workflow on the Adafruit repository.

This commit is contained in:
sommersoft 2019-10-22 20:05:22 -05:00
parent bd46e5efc6
commit db3e3928b8

View file

@ -8,8 +8,23 @@ on:
- cron: 0 10 * * *
jobs:
check-repo-owner:
# This job is so the entire workflow will end successfully and give some
# output to explain why it hasn't run on a non-Adafruit fork.
runs-on: ubuntu-latest
steps:
- name: repository
env:
OWNER_IS_ADAFRUIT: ${{ startswith(github.repository, 'adafruit') }}
run: |
echo "This workflow will only run if Adafruit is the repository owner."
echo "Repository owner is Adafruit: $OWNER_IS_ADAFRUIT"
build:
runs-on: ubuntu-latest
# Only run the build on Adafruit's repository. Forks won't have the secrets.
# Its necessary to do this here, since 'schedule' events cannot (currently)
# be limited (they run on all forks' default branches).
if: startswith(github.repository, 'adafruit')
steps:
- uses: actions/checkout@v1
with: