DEV: Only enable our self hosted runners on the discourse/discourse repo (#29024)

Our self hosted runners does not work for forked repositories.
This commit is contained in:
Alan Guo Xiang Tan 2024-09-30 11:18:20 +08:00 committed by GitHub
parent 20a3f976a2
commit c8bec538c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 21 additions and 21 deletions

View File

@ -10,7 +10,7 @@ permissions:
jobs: jobs:
triage: triage:
if: github.actor != 'discourse-translator-bot' if: github.actor != 'discourse-translator-bot'
runs-on: debian-12 runs-on: ubuntu-latest
steps: steps:
- uses: actions/labeler@v5 - uses: actions/labeler@v5

View File

@ -17,7 +17,7 @@ jobs:
build: build:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: run name: run
runs-on: debian-12 runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }}
container: discourse/discourse_test:slim container: discourse/discourse_test:slim
timeout-minutes: 10 timeout-minutes: 10

View File

@ -17,7 +17,7 @@ jobs:
build: build:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: run name: run
runs-on: debian-12 runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }}
container: discourse/discourse_test:slim container: discourse/discourse_test:slim
timeout-minutes: 30 timeout-minutes: 30

View File

@ -24,7 +24,7 @@ jobs:
tests: tests:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: Tests with Ruby ${{ matrix.ruby }} 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 container: discourse/discourse_test:slim
timeout-minutes: 20 timeout-minutes: 20
@ -126,11 +126,11 @@ jobs:
if: steps.app-cache.outputs.cache-hit != 'true' if: steps.app-cache.outputs.cache-hit != 'true'
run: rm -rf tmp/app-cache/uploads && cp -r public/uploads tmp/app-cache/uploads run: rm -rf tmp/app-cache/uploads && cp -r public/uploads tmp/app-cache/uploads
# - name: Check core database drift # - name: Check core database drift
# run: | # run: |
# mkdir /tmp/intermediate_db # mkdir /tmp/intermediate_db
# ./migrations/scripts/schema_generator /tmp/intermediate_db/base_migration.sql # ./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 # diff -u migrations/common/intermediate_db_schema/000_base_schema.sql /tmp/intermediate_db/base_migration.sql
- name: RSpec - name: RSpec
run: bin/rspec --default-path migrations/spec run: bin/rspec --default-path migrations/spec

View File

@ -4,14 +4,14 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
from: 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 required: true
default: 'latest-release' default: "latest-release"
type: string type: string
to: 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 required: true
default: 'HEAD' default: "HEAD"
type: string type: string
permissions: permissions:
@ -20,7 +20,7 @@ permissions:
jobs: jobs:
build: build:
name: run name: run
runs-on: debian-12 runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }}
container: discourse/discourse_test:slim container: discourse/discourse_test:slim
timeout-minutes: 10 timeout-minutes: 10
env: env:

View File

@ -1,7 +1,7 @@
name: 'Close stale PRs' name: "Close stale PRs"
on: on:
schedule: schedule:
- cron: '30 1 * * *' - cron: "30 1 * * *"
workflow_dispatch: workflow_dispatch:
permissions: permissions:
@ -9,11 +9,11 @@ permissions:
jobs: jobs:
stale: stale:
runs-on: debian-12 runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-latest') || 'debian-12' }}
steps: steps:
- uses: actions/stale@v9 - uses: actions/stale@v9
with: with:
days-before-stale: 60 days-before-stale: 60
days-before-close: 14 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 exempt-pr-labels: dependencies

View File

@ -29,7 +29,7 @@ jobs:
build: build:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' 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 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' || '' }} container: discourse/discourse_test:slim${{ (matrix.build_type == 'frontend' || matrix.build_type == 'system') && '-browsers' || '' }}
timeout-minutes: 20 timeout-minutes: 20
@ -366,7 +366,7 @@ jobs:
core_frontend_tests: core_frontend_tests:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror' if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: core frontend (${{ matrix.browser }}) name: core frontend (${{ matrix.browser }})
runs-on: debian-12 runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-22.04-8core') || 'debian-12' }}
container: container:
image: discourse/discourse_test:slim-browsers image: discourse/discourse_test:slim-browsers
options: --user discourse options: --user discourse