Skip to content

Commit

Permalink
Merge #3089 Don't run workflow steps that require secrets on forks
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jun 28, 2020
2 parents 64837ed + e820859 commit 2a92697
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ jobs:
run: xvfb-run ./build test+only --configuration=${{ matrix.configuration }} --where="Category!=FlakyNetwork"

- name: Send Discord Notification
if: failure()
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
if: ${{ env.DISCORD_WEBHOOK && failure() }}
run: |
git clone https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
Expand Down Expand Up @@ -92,12 +92,12 @@ jobs:
run: ./build test+only --configuration=${{ matrix.configuration }}

- name: Send Discord Notification
if: failure()
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
if: ${{ env.DISCORD_WEBHOOK && failure() }}
run: |
git clone --depth 1 https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_PASSWORD && env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}
run: |
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
./build docker-inflator
Expand All @@ -61,13 +62,15 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
SOURCE_DIR: _build/repack/Release
if: ${{ env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}

- name: Send Discord Notification
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
if: ${{ env.DISCORD_WEBHOOK }}
run: |
git clone --depth 1 https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
if: ${{ env.DISCORD_WEBHOOK }}]
run: |
git clone --depth 1 https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ All notable changes to this project will be documented in this file.
- [Core] Cache hashes on disk (#3080 by: HebaruSan; reviewed: DasSkelett)
- [Multiple] Don't fallback to Curl on 404, allow smaller GUI (#3084 by: HebaruSan; reviewed: DasSkelett)
- [Build] Move Travis CI to GitHub Workflows (#3085 by: DasSkelett; reviewed: techman83)
- [Build] Don't run workflow steps that require secrets on forks (#3089 by: DasSkelett; reviewed: HebaruSan)

## v1.27.2 (Chandrasekhar)

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 2a92697

Please sign in to comment.