diff --git a/.github/workflows/build_enterprise.yml b/.github/workflows/build_enterprise.yml index 7547d5291c..602b43a7e1 100644 --- a/.github/workflows/build_enterprise.yml +++ b/.github/workflows/build_enterprise.yml @@ -17,7 +17,7 @@ jobs: name: Build Enterprise APKs runs-on: ubuntu-latest # Skip in forks - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} strategy: matrix: variant: [debug, release, nightly] diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 5af04df63e..6b6ac8243e 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -6,15 +6,16 @@ jobs: build: runs-on: ubuntu-latest name: Danger main check + # Skip in forks, it doesn't work even with the fallback token + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} steps: - uses: actions/checkout@v4 - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} run: git submodule update --init --recursive - run: | npm install --save-dev @babel/plugin-transform-flow-strip-types diff --git a/.github/workflows/generate_github_pages.yml b/.github/workflows/generate_github_pages.yml index 96f64eb1f7..46494ba76a 100644 --- a/.github/workflows/generate_github_pages.yml +++ b/.github/workflows/generate_github_pages.yml @@ -9,7 +9,7 @@ jobs: generate-github-pages: runs-on: ubuntu-latest # Skip in forks - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} steps: - name: ⏬ Checkout with LFS uses: nschloe/action-cached-lfs-checkout@v1.2.2 diff --git a/.github/workflows/gradle-wrapper-update.yml b/.github/workflows/gradle-wrapper-update.yml index b3493e3bf7..d35bace705 100644 --- a/.github/workflows/gradle-wrapper-update.yml +++ b/.github/workflows/gradle-wrapper-update.yml @@ -12,7 +12,7 @@ jobs: - name: Update Gradle Wrapper uses: gradle-update/update-gradle-wrapper-action@v1 # Skip in forks - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: repo-token: ${{ secrets.GITHUB_TOKEN }} target-branch: develop diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 78961a0416..a0643c426f 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -20,11 +20,11 @@ jobs: - uses: actions/checkout@v4 - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} run: git submodule update --init --recursive - name: Run code quality check suite run: ./tools/check/check_code_quality.sh @@ -78,11 +78,11 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} run: git submodule update --init --recursive - name: Use JDK 17 uses: actions/setup-java@v4 @@ -118,11 +118,11 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} run: git submodule update --init --recursive - name: Use JDK 17 uses: actions/setup-java@v4 @@ -162,11 +162,11 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} run: git submodule update --init --recursive - name: Use JDK 17 uses: actions/setup-java@v4 @@ -202,11 +202,11 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} run: git submodule update --init --recursive - name: Use JDK 17 uses: actions/setup-java@v4 @@ -242,11 +242,11 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} run: git submodule update --init --recursive - name: Use JDK 17 uses: actions/setup-java@v4 @@ -277,6 +277,7 @@ jobs: name: Project Check Suite runs-on: ubuntu-latest needs: [konsist, lint, ktlint, detekt] + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9dfa6c56c3..38be804fc1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: enterprise: name: Create App Bundle Enterprise runs-on: ubuntu-latest - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} concurrency: group: ${{ format('build-release-main-gplay-{0}', github.sha) }} cancel-in-progress: true @@ -50,7 +50,7 @@ jobs: - uses: actions/checkout@v4 - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules diff --git a/.github/workflows/sync-localazy.yml b/.github/workflows/sync-localazy.yml index 347923a6c0..5f99cac17a 100644 --- a/.github/workflows/sync-localazy.yml +++ b/.github/workflows/sync-localazy.yml @@ -9,7 +9,7 @@ jobs: sync-localazy: runs-on: ubuntu-latest # Skip in forks - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} steps: - uses: actions/checkout@v4 - name: Use JDK 17 diff --git a/.github/workflows/sync-sas-strings.yml b/.github/workflows/sync-sas-strings.yml index f9bff2905b..d06cfe268a 100644 --- a/.github/workflows/sync-sas-strings.yml +++ b/.github/workflows/sync-sas-strings.yml @@ -9,7 +9,7 @@ jobs: sync-sas-strings: runs-on: ubuntu-latest # Skip in forks - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} # No concurrency required, runs every time on a schedule. steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d502abbb4..fa274baf89 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,11 +40,11 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - name: Add SSH private keys for submodule repositories uses: webfactory/ssh-agent@v0.9.0 - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} with: ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }} - name: Clone submodules - if: github.repository == 'element-hq/element-x-android' + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }} run: git submodule update --init --recursive - name: ☕️ Use JDK 17 uses: actions/setup-java@v4