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: