From 443753d8642bb46290b93c565664b596ad2a3539 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Wed, 18 Oct 2023 16:00:26 -0400 Subject: [PATCH] build: Only build and push ci-runner Docker image on origin repo (#33535) I get a weekly CI failure email due to this scheduled workflow running on my fork of edx-platform. Cancelling the job when it runs on a fork prevents this. --- .github/workflows/publish-ci-docker-image.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/publish-ci-docker-image.yml b/.github/workflows/publish-ci-docker-image.yml index 329e9ffba53b..fd1c2da1d4c0 100644 --- a/.github/workflows/publish-ci-docker-image.yml +++ b/.github/workflows/publish-ci-docker-image.yml @@ -13,6 +13,15 @@ jobs: - name: Checkout uses: actions/checkout@v2 + # This has to happen after checkout in order for gh to work. + - name: "Cancel scheduled job on forks" + if: github.repository != 'openedx/edx-platform' && github.event_name == 'schedule' + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: | + gh run cancel "${{ github.run_id }}" + gh run watch "${{ github.run_id }}" + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: