From 38b3f5e880ca2cb9e159f3b123cb2347b060d27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Thu, 16 Feb 2023 03:12:55 +0100 Subject: [PATCH] Tweak fledge workflow --- .github/workflows/fledge.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fledge.yaml b/.github/workflows/fledge.yaml index df80642..b55cb13 100644 --- a/.github/workflows/fledge.yaml +++ b/.github/workflows/fledge.yaml @@ -3,10 +3,6 @@ name: fledge on: # for manual triggers workflow_dispatch: - # for debugging - push: - paths: - - .github/workflows/fledge.yaml # daily run schedule: - cron: "30 0 * * *" @@ -16,8 +12,20 @@ concurrency: cancel-in-progress: true jobs: + check_fork: + runs-on: ubuntu-latest + outputs: + is_forked: ${{ steps.check.outputs.is_forked }} + steps: + - name: Check if the repo is forked + id: check + run: | + echo "is_forked=$(curl -s -H "Accept: application/vnd.github+json" -H 'Authorization: Bearer ${{ github.token }}' -H "X-GitHub-Api-Version: 2022-11-28" ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY} | jq .fork)" >> $GITHUB_OUTPUT + fledge: runs-on: ubuntu-latest + needs: check_fork + if: needs.check_fork.outputs.is_forked == 'false' permissions: contents: write env: