diff --git a/.github/workflows/deploy-automator.yml b/.github/workflows/deploy-automator.yml index cb39047..33756de 100644 --- a/.github/workflows/deploy-automator.yml +++ b/.github/workflows/deploy-automator.yml @@ -28,12 +28,14 @@ env: jobs: deploy: - runs-on: ubuntu-latest + runs-on: [self-hosted, contabo] permissions: id-token: write # request the OIDC token for AWS role assumption contents: read # Deploy only when Test Automator passed on main, or when manually run from main. - if: (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') + # A fork PR from a branch named main also reports head_branch == 'main'; + # only deploy test runs of this repository's own code. + if: (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' && github.event.workflow_run.head_repository.full_name == github.repository) || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') defaults: run: working-directory: automator diff --git a/.github/workflows/deploy-router.yml b/.github/workflows/deploy-router.yml index 8ca9cf2..39c9f7d 100644 --- a/.github/workflows/deploy-router.yml +++ b/.github/workflows/deploy-router.yml @@ -14,12 +14,14 @@ env: jobs: deploy-router: - runs-on: ubuntu-latest + runs-on: [self-hosted, contabo] permissions: id-token: write # request the OIDC token for AWS role assumption contents: read # Deploy only when Test Router passed on main, or when manually run from main. - if: (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') + # A fork PR from a branch named main also reports head_branch == 'main'; + # only deploy test runs of this repository's own code. + if: (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' && github.event.workflow_run.head_repository.full_name == github.repository) || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') defaults: run: working-directory: router diff --git a/.github/workflows/replay-audit-receipts.yml b/.github/workflows/replay-audit-receipts.yml index a6cc589..09d52f8 100644 --- a/.github/workflows/replay-audit-receipts.yml +++ b/.github/workflows/replay-audit-receipts.yml @@ -12,7 +12,7 @@ on: jobs: replay: - runs-on: ubuntu-latest + runs-on: [self-hosted, contabo] permissions: id-token: write contents: read diff --git a/.github/workflows/test-automator.yml b/.github/workflows/test-automator.yml index 95ce0a8..8369da5 100644 --- a/.github/workflows/test-automator.yml +++ b/.github/workflows/test-automator.yml @@ -15,7 +15,8 @@ on: jobs: test: - runs-on: ubuntu-latest + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + runs-on: [self-hosted, contabo] defaults: run: working-directory: automator diff --git a/.github/workflows/test-router.yml b/.github/workflows/test-router.yml index 05b2100..4bd26de 100644 --- a/.github/workflows/test-router.yml +++ b/.github/workflows/test-router.yml @@ -15,7 +15,8 @@ on: jobs: test: - runs-on: ubuntu-latest + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + runs-on: [self-hosted, contabo] defaults: run: working-directory: router