From 3a8bc4cd9c908ba84c07b0ae2ffd76ba00e68f41 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:36:40 +0100 Subject: [PATCH] Update actions/github-script action to v7 (#2152) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update actions/github-script action to v7 * Fix issues with both the PR from fork welcome comment and skipping Maestro for PRs coming from forks. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín --- .github/workflows/fork-pr-notice.yml | 13 +++++++------ .github/workflows/maestro.yml | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/fork-pr-notice.yml b/.github/workflows/fork-pr-notice.yml index dd697915f7..42b1e54c3f 100644 --- a/.github/workflows/fork-pr-notice.yml +++ b/.github/workflows/fork-pr-notice.yml @@ -11,9 +11,10 @@ jobs: welcome: runs-on: ubuntu-latest name: Welcome comment + if: github.event.pull_request.fork != null steps: - name: Add auto-generated commit warning - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | github.rest.issues.createComment({ @@ -22,9 +23,9 @@ jobs: repo: context.repo.repo, body: `Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible: - - Your branch should be based on `origin/develop`, at least when it was created. - - There is a changelog entry in the `changelog.d` folder with [the Towncrier format](https://towncrier.readthedocs.io/en/latest/tutorial.html#creating-news-fragments). - - The test pass locally running `./gradlew test`. - - The code quality check suite pass locally running `./gradlew runQualityChecks`. - - If you modified anything related to the UI, including previews, you'll have to run the `Record screenshots` GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, **it will prevent the CI from running temporarily**, until you upload a new commit after that one. To do so, just pull the latest changes and push [an empty commit](https://coderwall.com/p/vkdekq/git-commit-allow-empty).` + - Your branch should be based on \`origin/develop\`, at least when it was created. + - There is a changelog entry in the \`changelog.d\` folder with [the Towncrier format](https://towncrier.readthedocs.io/en/latest/tutorial.html#creating-news-fragments). + - The test pass locally running \`./gradlew test\`. + - The code quality check suite pass locally running \`./gradlew runQualityChecks\`. + - If you modified anything related to the UI, including previews, you'll have to run the \`Record screenshots\` GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, **it will prevent the CI from running temporarily**, until you upload a new commit after that one. To do so, just pull the latest changes and push [an empty commit](https://coderwall.com/p/vkdekq/git-commit-allow-empty).` }) diff --git a/.github/workflows/maestro.yml b/.github/workflows/maestro.yml index 3b52235fb5..0e2dc74b92 100644 --- a/.github/workflows/maestro.yml +++ b/.github/workflows/maestro.yml @@ -24,31 +24,31 @@ jobs: cancel-in-progress: true steps: - name: Remove Run-Maestro label - if: ${{ !github.event.pull_request.fork && github.event.label.name == 'Run-Maestro' }} + if: ${{ github.event_name == 'pull_request' && github.event.label.name == 'Run-Maestro' }} uses: actions-ecosystem/action-remove-labels@v1 with: labels: Run-Maestro - uses: actions/checkout@v4 - if: ${{ !github.event.pull_request.fork }} + if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' with: # Ensure we are building the branch and not the branch after being merged on develop # https://github.com/actions/checkout/issues/881 ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - uses: actions/setup-java@v4 name: Use JDK 17 - if: ${{ !github.event.pull_request.fork }} + if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' with: distribution: 'temurin' # See 'Supported distributions' for available options java-version: '17' - name: Assemble debug APK run: ./gradlew :app:assembleDebug $CI_GRADLE_ARG_PROPERTIES - if: ${{ !github.event.pull_request.fork }} + if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' env: ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }} ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }} ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }} - uses: mobile-dev-inc/action-maestro-cloud@v1.8.0 - if: ${{ !github.event.pull_request.fork }} + if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' with: api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }} # Doc says (https://github.com/mobile-dev-inc/action-maestro-cloud#android):