From c8bec538c37f6d9a3b5f11d315732a170ebf1a90 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Mon, 30 Sep 2024 11:18:20 +0800 Subject: [PATCH] DEV: Only enable our self hosted runners on the discourse/discourse repo (#29024) Our self hosted runners does not work for forked repositories. --- .github/workflows/labeler.yml | 2 +- .github/workflows/licenses.yml | 2 +- .github/workflows/linting.yml | 2 +- .github/workflows/migration-tests.yml | 12 ++++++------ .github/workflows/release-notes.yml | 12 ++++++------ .github/workflows/stale-pr-closer.yml | 8 ++++---- .github/workflows/tests.yml | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index ccadfb89777..0b3e2515d7d 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -10,7 +10,7 @@ permissions: jobs: triage: if: github.actor != 'discourse-translator-bot' - runs-on: debian-12 + runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 diff --git a/.github/workflows/licenses.yml b/.github/workflows/licenses.yml index 9e7a6384beb..1b8252cb174 100644 --- a/.github/workflows/licenses.yml +++ b/.github/workflows/licenses.yml @@ -17,7 +17,7 @@ jobs: build: if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: run - runs-on: debian-12 + runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }} container: discourse/discourse_test:slim timeout-minutes: 10 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 13990395090..d016f50cd4a 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -17,7 +17,7 @@ jobs: build: if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: run - runs-on: debian-12 + runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }} container: discourse/discourse_test:slim timeout-minutes: 30 diff --git a/.github/workflows/migration-tests.yml b/.github/workflows/migration-tests.yml index f39602de7eb..a1f4e119f8c 100644 --- a/.github/workflows/migration-tests.yml +++ b/.github/workflows/migration-tests.yml @@ -24,7 +24,7 @@ jobs: tests: if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: Tests with Ruby ${{ matrix.ruby }} - runs-on: debian-12 + runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }} container: discourse/discourse_test:slim timeout-minutes: 20 @@ -126,11 +126,11 @@ jobs: if: steps.app-cache.outputs.cache-hit != 'true' run: rm -rf tmp/app-cache/uploads && cp -r public/uploads tmp/app-cache/uploads -# - name: Check core database drift -# run: | -# mkdir /tmp/intermediate_db -# ./migrations/scripts/schema_generator /tmp/intermediate_db/base_migration.sql -# diff -u migrations/common/intermediate_db_schema/000_base_schema.sql /tmp/intermediate_db/base_migration.sql + # - name: Check core database drift + # run: | + # mkdir /tmp/intermediate_db + # ./migrations/scripts/schema_generator /tmp/intermediate_db/base_migration.sql + # diff -u migrations/common/intermediate_db_schema/000_base_schema.sql /tmp/intermediate_db/base_migration.sql - name: RSpec run: bin/rspec --default-path migrations/spec diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 2d2fcf65a60..eb0a35d45a8 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -4,14 +4,14 @@ on: workflow_dispatch: inputs: from: - description: 'Starting ref (exclusive). Can be a tag, branch or commit ref. `latest-release` refers to the last beta version bump.' + description: "Starting ref (exclusive). Can be a tag, branch or commit ref. `latest-release` refers to the last beta version bump." required: true - default: 'latest-release' + default: "latest-release" type: string to: - description: 'Ending ref (inclusive). Can be a tag, branch or commit ref. `HEAD` refers to the most recent commit.' + description: "Ending ref (inclusive). Can be a tag, branch or commit ref. `HEAD` refers to the most recent commit." required: true - default: 'HEAD' + default: "HEAD" type: string permissions: @@ -20,7 +20,7 @@ permissions: jobs: build: name: run - runs-on: debian-12 + runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }} container: discourse/discourse_test:slim timeout-minutes: 10 env: @@ -87,7 +87,7 @@ jobs: echo "From: $from_ref - $(git rev-parse --short $from_ref) - ${{ steps.dates.outputs.from }}" >> $GITHUB_STEP_SUMMARY echo "To: $to_ref - $(git rev-parse --short $to_ref) - ${{ steps.dates.outputs.to }}" >> $GITHUB_STEP_SUMMARY - + echo "" >> $GITHUB_STEP_SUMMARY echo "---" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/stale-pr-closer.yml b/.github/workflows/stale-pr-closer.yml index b0469f4f9ad..de7299191d9 100644 --- a/.github/workflows/stale-pr-closer.yml +++ b/.github/workflows/stale-pr-closer.yml @@ -1,7 +1,7 @@ -name: 'Close stale PRs' +name: "Close stale PRs" on: schedule: - - cron: '30 1 * * *' + - cron: "30 1 * * *" workflow_dispatch: permissions: @@ -9,11 +9,11 @@ permissions: jobs: stale: - runs-on: debian-12 + runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }} steps: - uses: actions/stale@v9 with: days-before-stale: 60 days-before-close: 14 - stale-pr-message: 'This pull request has been automatically marked as stale because it has been open for 60 days with no activity. To keep it open, remove the stale tag, push code, or add a comment. Otherwise, it will be closed in 14 days.' + stale-pr-message: "This pull request has been automatically marked as stale because it has been open for 60 days with no activity. To keep it open, remove the stale tag, push code, or add a comment. Otherwise, it will be closed in 14 days." exempt-pr-labels: dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb5133525f6..89737d8a00d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: build: if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: ${{ matrix.target }} ${{ matrix.build_type }} # Update fetch-job-id step if changing this - runs-on: debian-12 + runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-22.04-8core') || 'debian-12' }} container: discourse/discourse_test:slim${{ (matrix.build_type == 'frontend' || matrix.build_type == 'system') && '-browsers' || '' }} timeout-minutes: 20 @@ -366,7 +366,7 @@ jobs: core_frontend_tests: if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' name: core frontend (${{ matrix.browser }}) - runs-on: debian-12 + runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-22.04-8core') || 'debian-12' }} container: image: discourse/discourse_test:slim-browsers options: --user discourse