Skip to content

Commit

Permalink
Don't run workflow steps that require secrets on forks
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett committed Jun 28, 2020
1 parent ef6e68e commit 66a961e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
run: ./build test+only --configuration=${{ matrix.configuration }}

- name: Send Discord Notification
if: failure()
if: secrets.DISCORD_WEBHOOK && failure()
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
run: xvfb-run ./build test+only --configuration=Release --where="Category!=FlakyNetwork"

- name: Generate Docker image and publish to Hub
if: secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_PASSWORD && secrets.AWS_ACCESS_KEY_ID && secrets.AWS_SECRET_ACCESS_KEY
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand All @@ -51,6 +52,7 @@ jobs:
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
./build docker-inflator
- name: Push to S3
if: secrets.AWS_ACCESS_KEY_ID && secrets.AWS_SECRET_ACCESS_KEY
# Send ckan.exe and netkan.exe to https://ksp-ckan.s3-us-west-2.amazonaws.com/
uses: jakejarvis/s3-sync-action@master
with:
Expand All @@ -63,6 +65,7 @@ jobs:
SOURCE_DIR: _build/repack/Release

- name: Send Discord Notification
if: secrets.DISCORD_WEBHOOK
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
asset_content_type: application/vnd.microsoft.portable-executable

- name: Send Discord Notification
if: secrets.DISCORD_WEBHOOK
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
Expand Down
3 changes: 2 additions & 1 deletion Tests/NetKAN/Sources/Spacedock/SpacedockApiTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Net;
using CKAN;
using CKAN.NetKAN.Services;
using CKAN.NetKAN.Sources.Spacedock;
Expand Down Expand Up @@ -72,7 +73,7 @@ public void ThrowsWhenModMissing()
TestDelegate act = () => sut.GetMod(-1);

// Assert
Assert.That(act, Throws.Exception.InstanceOf<Kraken>());
Assert.That(act, Throws.Exception.InstanceOf<WebException>());
}
}
}

0 comments on commit 66a961e

Please sign in to comment.