Skip to content

Commit 2582843

Browse files
committed
CI: Run package job only if Github secrets are available
following a trick learned from actions/runner#520
1 parent 4e459a5 commit 2582843

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: "Build and package"
22
on:
33
pull_request:
44
push:
5+
6+
env:
7+
SECRETS_ARE_AVAILABLE: ${{ secrets.SECRETS_ARE_AVAILABLE }}
8+
59
jobs:
610
build:
711
strategy:
@@ -67,8 +71,8 @@ jobs:
6771
package:
6872
# this will only work when the jobs above have uploaded
6973
# their stuff to the nix cache, which will only work
70-
# in this repository
71-
if: github.repository == 'entropia/tip-toi-reveng'
74+
# if secrets are available
75+
if: ${{ env.SECRETS_ARE_AVAILABLE }}
7276
runs-on: ubuntu-latest
7377
needs: build
7478
steps:

0 commit comments

Comments
 (0)