Only run the GitHub Actions workflow on the Adafruit repository.
This commit is contained in:
parent
bd46e5efc6
commit
db3e3928b8
1 changed files with 15 additions and 0 deletions
15
.github/workflows/workflow.yml
vendored
15
.github/workflows/workflow.yml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue