This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 14890f0 Disables self-hosted runs for non-apache-owned repositories
(#14239)
14890f0 is described below
commit 14890f0c9cbc83e59acf8ace4dfd24d6c63b2c63
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Feb 15 17:34:37 2021 +0100
Disables self-hosted runs for non-apache-owned repositories (#14239)
When the user wants to test pull requests or - especilly - master
build in their own fork, they will not likely have self-hosted
runners configured and the builds will fail.
This change uses self-hosted runners only if the build is run in
the context of the `apache/airflow` repository.
---
.github/workflows/build-images-workflow-run.yml | 4 ++--
.github/workflows/ci.yml | 20 ++++++++++++--------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/build-images-workflow-run.yml
b/.github/workflows/build-images-workflow-run.yml
index 42c70ff..449c7e7 100644
--- a/.github/workflows/build-images-workflow-run.yml
+++ b/.github/workflows/build-images-workflow-run.yml
@@ -48,7 +48,7 @@ jobs:
cancel-workflow-runs:
timeout-minutes: 10
name: "Cancel workflow runs"
- runs-on: [self-hosted]
+ runs-on: ${{ github.repository == 'apache/airflow' && 'self-hosted' ||
'ubuntu-20.04' }}
outputs:
sourceHeadRepo: ${{ steps.source-run-info.outputs.sourceHeadRepo }}
sourceHeadBranch: ${{ steps.source-run-info.outputs.sourceHeadBranch }}
@@ -61,7 +61,7 @@ jobs:
sourceEvent: ${{ steps.source-run-info.outputs.sourceEvent }}
cacheDirective: ${{ steps.cache-directive.outputs.docker-cache }}
buildImages: ${{ steps.build-images.outputs.buildImages }}
- runsOn: '["self-hosted"]'
+ runsOn: ${{ github.repository == 'apache/airflow' && 'self-hosted' ||
'ubuntu-20.04' }}
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e4f4407..bdcf82e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -71,18 +71,22 @@ jobs:
name: "Build info"
runs-on: >-
${{ (
- github.event_name == 'push' ||
- github.event_name == 'schedule' ||
- github.event.pull_request.author_association == 'OWNER' ||
- github.event.pull_request.author_association == 'MEMBER'
- ) && 'self-hosted' || 'ubuntu-20.04' }}
- env:
- GITHUB_CONTEXT: ${{ toJson(github) }}
- RUNS_ON: ${{ (
+ (
github.event_name == 'push' ||
github.event_name == 'schedule' ||
github.event.pull_request.author_association == 'OWNER' ||
github.event.pull_request.author_association == 'MEMBER'
+ ) && github.repository == 'apache/airflow'
+ ) && 'self-hosted' || 'ubuntu-20.04' }}
+ env:
+ GITHUB_CONTEXT: ${{ toJson(github) }}
+ RUNS_ON: ${{ (
+ (
+ github.event_name == 'push' ||
+ github.event_name == 'schedule' ||
+ github.event.pull_request.author_association == 'OWNER' ||
+ github.event.pull_request.author_association == 'MEMBER'
+ ) && github.repository == 'apache/airflow'
) && 'self-hosted' || 'ubuntu-20.04' }}
outputs:
waitForImage: ${{ steps.wait-for-image.outputs.wait-for-image }}