Skip to content

Commit

Permalink
Don't try to run inappropriate CI on forked repositories (speeduino#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantob authored Jun 29, 2022
1 parent c6d9fd7 commit a330b78
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/build-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: platformio run -e teensy35 -e teensy36 -e teensy41 -e black_F407VE -e megaatmega2561 -e megaatmega2560
- name: Build test atmel
run: platformio run -e megaatmega2560 -e megaatmega2561

- name: Build test teensy
run: platformio run -e teensy35 -e teensy36 -e teensy41

- name: Build test STM32
run: platformio run -e black_F407VE -e BlackPill_F401CC -e BlackPill_F411CE_USB

- name: Upload to Speeduino server
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
env:
WEB_PWD: ${{ secrets.WEB_PWD }}
run: |
Expand All @@ -51,7 +57,7 @@ jobs:
- name: Slack Notification (Passed)
uses: rtCamp/action-slack-notify@v2
if: success() && github.event_name != 'pull_request'
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
env:
SLACK_CHANNEL: git
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
Expand All @@ -63,7 +69,7 @@ jobs:

- name: Slack Notification (Failed)
uses: rtCamp/action-slack-notify@v2
if: failure() && github.event_name != 'pull_request'
if: failure() && github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
env:
SLACK_CHANNEL: git
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# This is a basic workflow to help you get started with Actions

name: Doxygen Action
name: Build and update Doxygen documentation

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]



# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Expand All @@ -22,21 +18,20 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Doxygen Action
uses: mattnotmitt/doxygen-action@v1.1.0
- name: Build Doxygen documentation
uses: mattnotmitt/doxygen-action@v1.9
with:
# Path to Doxyfile
doxyfile-path: "./Doxyfile" # default is ./Doxyfile
# Working directory
working-directory: "." # default is .

- name: Setup git config
if: github.repository_owner == 'noisymime'
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: Commit Doxygen HTML
if: github.event_name != 'pull_request'
- name: Commit updated Doxygen documentation
if: github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
env:
GH_DOXYGEN: ${{ secrets.GH_DOXYGEN }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This is a basic workflow to help you get started with Actions

name: Unit Tests

# Controls when the workflow will run
Expand All @@ -13,6 +11,8 @@ on:

jobs:
build:
# Only try to run hardware unit tests on the upstream repository
if: github.repository_owner == 'noisymime'

runs-on: ubuntu-latest

Expand Down Expand Up @@ -67,4 +67,4 @@ jobs:
SLACK_TITLE: 'Unit tests FAILED :warning:'
SLACK_USERNAME: Github
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: actions url,commit
MSG_MINIMAL: actions url,commit

0 comments on commit a330b78

Please sign in to comment.