From b25ac238f5dd310f3126ab92eabab1d34c9e76c8 Mon Sep 17 00:00:00 2001 From: Ajay Krishnan Date: Mon, 20 Jul 2026 11:41:52 -0700 Subject: [PATCH] Run upstream watcher only on GitHub --- .github/workflows/watch-upstream.yml | 1 + test/watcher_test.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/watch-upstream.yml b/.github/workflows/watch-upstream.yml index af9f37c..1adf5b3 100644 --- a/.github/workflows/watch-upstream.yml +++ b/.github/workflows/watch-upstream.yml @@ -15,6 +15,7 @@ concurrency: jobs: open-compatibility-pr: + if: github.server_url == 'https://github.com' runs-on: ubuntu-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 diff --git a/test/watcher_test.rb b/test/watcher_test.rb index dd3dfa4..d4b0d2a 100644 --- a/test/watcher_test.rb +++ b/test/watcher_test.rb @@ -170,6 +170,10 @@ class WatcherTest < Minitest::Test def test_workflow_can_only_update_manifests_and_open_a_pr workflow = File.read(File.join(ROOT, ".github/workflows/watch-upstream.yml")) + assert_match( + /\n open-compatibility-pr:\n if: github\.server_url == 'https:\/\/github\.com'\n runs-on:/, + workflow + ) assert_includes workflow, "contents: write" assert_includes workflow, "pull-requests: write" assert_includes workflow, "git add manifests/image-matrix.json manifests/upstream.json"