From a153e367981be0bca07d3ce94bfa1a90d685ba4f Mon Sep 17 00:00:00 2001 From: Jan Nowakowski Date: Mon, 9 Dec 2024 09:27:10 +0100 Subject: [PATCH 1/5] Create workflow to warn on native file changes --- .../workflows/commentOnNativeFileChanged.yml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/commentOnNativeFileChanged.yml diff --git a/.github/workflows/commentOnNativeFileChanged.yml b/.github/workflows/commentOnNativeFileChanged.yml new file mode 100644 index 0000000000000..1120a654377a8 --- /dev/null +++ b/.github/workflows/commentOnNativeFileChanged.yml @@ -0,0 +1,21 @@ +name: Comment on native files changed + +on: + pull_request: + branches: + - 'main' + paths: + - '**.kt' + - '**.java' + - '**.swift' + - '**.mm' + - '**.h' + +jobs: + commentOnNativeFilesChanged: + name: Create comment + run: | + gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} --body \ + ":warning: This PR changes native code. It may cause problems in Hybrid App. Please notify people working on it to review those changes. :warning:" + env: + GITHUB_TOKEN: ${{ github.token }} From f2390fbf8a0a238adc1a7bfbeec66578aa685cf0 Mon Sep 17 00:00:00 2001 From: Jan Nowakowski Date: Thu, 19 Dec 2024 12:42:44 +0100 Subject: [PATCH 2/5] fix workflow --- .../workflows/commentOnNativeFileChanged.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/commentOnNativeFileChanged.yml b/.github/workflows/commentOnNativeFileChanged.yml index 1120a654377a8..bc5593ec3da43 100644 --- a/.github/workflows/commentOnNativeFileChanged.yml +++ b/.github/workflows/commentOnNativeFileChanged.yml @@ -11,11 +11,18 @@ on: - '**.mm' - '**.h' + +env: + PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }} + jobs: commentOnNativeFilesChanged: name: Create comment - run: | - gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} --body \ - ":warning: This PR changes native code. It may cause problems in Hybrid App. Please notify people working on it to review those changes. :warning:" - env: - GITHUB_TOKEN: ${{ github.token }} + runs-on: ubuntu-latest + steps: + - name: Comment + run: | + gh pr comment ${{ env.PULL_REQUEST_NUMBER }} --body \ + ":warning: This PR changes native code. It may cause problems in Hybrid App. Please notify people working on it to review those changes. :warning:" + env: + GITHUB_TOKEN: ${{ github.token }} From 572cf5d211106f5901fe7e06f624d72b1f9275e2 Mon Sep 17 00:00:00 2001 From: Jan Nowakowski Date: Fri, 10 Jan 2025 11:08:16 +0100 Subject: [PATCH 3/5] Add more files to paths --- .github/workflows/commentOnNativeFileChanged.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/commentOnNativeFileChanged.yml b/.github/workflows/commentOnNativeFileChanged.yml index bc5593ec3da43..a4f4a1720d48b 100644 --- a/.github/workflows/commentOnNativeFileChanged.yml +++ b/.github/workflows/commentOnNativeFileChanged.yml @@ -10,10 +10,9 @@ on: - '**.swift' - '**.mm' - '**.h' - - -env: - PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }} + - 'AndroidManifest.xml' + - 'project.pbxproj' + - 'package.json' jobs: commentOnNativeFilesChanged: @@ -22,7 +21,7 @@ jobs: steps: - name: Comment run: | - gh pr comment ${{ env.PULL_REQUEST_NUMBER }} --body \ - ":warning: This PR changes native code. It may cause problems in Hybrid App. Please notify people working on it to review those changes. :warning:" + gh pr comment ${{ github.event.number }} --body \ + ":warning: This PR may change native code. It may cause problems in Hybrid App. Please notify people working on it to review those changes. :warning:" env: GITHUB_TOKEN: ${{ github.token }} From a66c745bb1e1f971a67e5d6de17fbcc43e81afe6 Mon Sep 17 00:00:00 2001 From: Jan Nowakowski Date: Mon, 13 Jan 2025 09:23:16 +0100 Subject: [PATCH 4/5] Small changes --- .github/workflows/commentOnNativeFileChanged.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commentOnNativeFileChanged.yml b/.github/workflows/commentOnNativeFileChanged.yml index a4f4a1720d48b..83df428c53516 100644 --- a/.github/workflows/commentOnNativeFileChanged.yml +++ b/.github/workflows/commentOnNativeFileChanged.yml @@ -10,9 +10,9 @@ on: - '**.swift' - '**.mm' - '**.h' + - '**.cpp' - 'AndroidManifest.xml' - 'project.pbxproj' - - 'package.json' jobs: commentOnNativeFilesChanged: @@ -22,6 +22,6 @@ jobs: - name: Comment run: | gh pr comment ${{ github.event.number }} --body \ - ":warning: This PR may change native code. It may cause problems in Hybrid App. Please notify people working on it to review those changes. :warning:" + ":warning: This PR may change native code. It may cause problems in Hybrid App. Please ask Hybrid App team to review those changes. :warning:" env: GITHUB_TOKEN: ${{ github.token }} From 085df1f7e6420724d294bf8634c16c4ae52973cf Mon Sep 17 00:00:00 2001 From: Jan Nowakowski <56261019+jnowakow@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:12:26 +0100 Subject: [PATCH 5/5] Update comment Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com> --- .github/workflows/commentOnNativeFileChanged.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commentOnNativeFileChanged.yml b/.github/workflows/commentOnNativeFileChanged.yml index 83df428c53516..4590a80af7078 100644 --- a/.github/workflows/commentOnNativeFileChanged.yml +++ b/.github/workflows/commentOnNativeFileChanged.yml @@ -22,6 +22,6 @@ jobs: - name: Comment run: | gh pr comment ${{ github.event.number }} --body \ - ":warning: This PR may change native code. It may cause problems in Hybrid App. Please ask Hybrid App team to review those changes. :warning:" + ":warning: This PR is possibly changing native code. It may cause problems in Hybrid App. Please ask Hybrid App team to review those changes in the Slack open-source channel. The C+ can help you with that. :warning:" env: GITHUB_TOKEN: ${{ github.token }}