Skip to contentSkip to conversation

.github: add github action to automate PR handling

PATCH Superseded [email protected] 3 participants 6 messages Jul 8, 2024 – Jul 9, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover .github: add github action to automate PR handling

From: Dongdong Zhang <[email protected]>

Changes in v2:
- Adopted Edgar Bonet's suggestion to retain the original pull request template.Restored .github/pull_request_template.md to its original form. This way, developers will see the prompt when creating a pull request, without having to wait for the workflow to complete.

Dongdong Zhang (1):
.github: add github action to automate PR handling

 .github/workflows/repo-lockdown.yml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 .github/workflows/repo-lockdown.yml
Signature · 6 lines
2.17.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH v2 1/1 .github: add github action to automate PR handling

From: Dongdong Zhang <[email protected]>

This patch updates the Buildroot repository's GitHub configuration to better manage incoming pull requests.

- Added a new GitHub Actions workflow (repo-lockdown.yml) to automatically handle new pull requests.

The new workflow:
- Triggers on new pull requests.
- Uses the dessant/repo-lockdown action to:
- Comment on the pull request, guiding contributors to use the mailing list for patch submission.
- Lock the pull request to prevent further discussion.
- Close the pull request.

This change ensures that contributors are properly directed to the preferred method of patch submission via the mailing list, maintaining consistency and streamlining the review process.

---
 .github/workflows/repo-lockdown.yml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 .github/workflows/repo-lockdown.yml
.github/workflows/repo-lockdown.yml new file +23 -0
new file mode 100644
index 0000000000..a5f8bd6a93
@@ -0,0 +1,23 @@
+name: 'Repo Lockdown'
+
+on:
+  pull_request_target:
+    types: opened
+
+permissions:
+  pull-requests: write
+
+jobs:
+  action:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: dessant/repo-lockdown@v4
+        with:
+          pr-comment: |
+            Please do not submit a Pull Request via GitHub. Buildroot makes use of a
+            [mailing list](http://lists.buildroot.org/mailman/listinfo/buildroot) for patch submission and review.
+            See [submitting your own patches](http://buildroot.org/manual.html#submitting-patches) for more info.
+
+            Thanks for your help!
+          lock-pr: true
+          close-pr: true
\ No newline at end of file
Signature · 6 lines
2.17.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 37 lines · On Sun, Jul 7, 2024 at 7:38 PM <[email protected]> wrote:

From: Dongdong Zhang <[email protected]>

This patch updates the Buildroot repository's GitHub configuration to better manage incoming pull requests.

- Added a new GitHub Actions workflow (repo-lockdown.yml) to automatically handle new pull requests.

The new workflow:
- Triggers on new pull requests.
- Uses the dessant/repo-lockdown action to:
- Comment on the pull request, guiding contributors to use the mailing list for patch submission.
- Lock the pull request to prevent further discussion.
- Close the pull request.

This change ensures that contributors are properly directed to the preferred method of patch submission via the mailing list, maintaining consistency and streamlining the review process.

---
 .github/workflows/repo-lockdown.yml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 .github/workflows/repo-lockdown.yml
.github/workflows/repo-lockdown.yml new file +4 -0
new file mode 100644
index 0000000000..a5f8bd6a93
@@ -0,0 +1,23 @@
+name: 'Repo Lockdown'
+
+on:
+  pull_request_target:

.github/workflows/repo-lockdown.yml line 14

Quoted 10 lines
.github/workflows/repo-lockdown.yml new file +10 -0
+    types: opened
+
+permissions:
+  pull-requests: write
+
+jobs:
+  action:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: dessant/repo-lockdown@v4

Can probably just use a github script along these lines or something:
https://github.com/sbabic/swupdate/blob/2024.05.2/.github/workflows/contributing.yml

probably also needs a conditional so it only runs on the one github repo:
if: github.repository == ‘buildroot/buildroot’

Quoted 13 lines
.github/workflows/repo-lockdown.yml new file +9 -1
+        with:
+          pr-comment: |
+            Please do not submit a Pull Request via GitHub. Buildroot makes use of a
+            [mailing list](http://lists.buildroot.org/mailman/listinfo/buildroot) for patch submission and review.
+            See [submitting your own patches](http://buildroot.org/manual.html#submitting-patches) for more info.
+
+            Thanks for your help!
+          lock-pr: true
+          close-pr: true
\ No newline at end of file
--

2.17.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
Quoted 57 lines

-----原始邮件-----发件人:"James Hilliard" <[email protected]>发送时间:2024-07-08 10:13:30 (星期一)收件人:[email protected]抄送:[email protected], [email protected]主题:Re: [Buildroot] [PATCH v2 1/1] .github: add github action to automate PR handling

Quoted 37 lines · On Sun, Jul 7, 2024 at 7:38 PM <[email protected]> wrote:

From: Dongdong Zhang <[email protected]>

This patch updates the Buildroot repository's GitHub configuration to better manage incoming pull requests.

- Added a new GitHub Actions workflow (repo-lockdown.yml) to automatically handle new pull requests.

The new workflow:
- Triggers on new pull requests.
- Uses the dessant/repo-lockdown action to:
- Comment on the pull request, guiding contributors to use the mailing list for patch submission.
- Lock the pull request to prevent further discussion.
- Close the pull request.

This change ensures that contributors are properly directed to the preferred method of patch submission via the mailing list, maintaining consistency and streamlining the review process.

---
 .github/workflows/repo-lockdown.yml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 .github/workflows/repo-lockdown.yml
.github/workflows/repo-lockdown.yml new file +4 -0
new file mode 100644
index 0000000000..a5f8bd6a93
@@ -0,0 +1,23 @@
+name: 'Repo Lockdown'
+
+on:
+  pull_request_target:

.github/workflows/repo-lockdown.yml line 14

Quoted 10 lines
.github/workflows/repo-lockdown.yml new file +10 -0
+    types: opened
+
+permissions:
+  pull-requests: write
+
+jobs:
+  action:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: dessant/repo-lockdown@v4

Can probably just use a github script along these lines or something:
https://github.com/sbabic/swupdate/blob/2024.05.2/.github/workflows/contributing.yml

Quoted 3 lines

probably also needs a conditional so it only runs on the one github repo:
if: github.repository == ‘buildroot/buildroot’

Hi, James,
In this scenario, I believe that using dessant/repo-lockdown@v4 is more suitable than actions/github-script@v5. dessant/repo-lockdown@v4 is specifically focused on repository lockdown functionality and has been widely used and validated. In contrast, while actions/github-script@v5 is flexible, it requires more customization and maintenance work and a strong familiarity with JavaScript. To keep the process simple and stable, I have decided to continue using dessant/repo-lockdown@v4.

Thank you again for your suggestion.

Quoted 13 lines
Quoted 13 lines
.github/workflows/repo-lockdown.yml new file +9 -1
+        with:
+          pr-comment: |
+            Please do not submit a Pull Request via GitHub. Buildroot makes use of a
+            [mailing list](http://lists.buildroot.org/mailman/listinfo/buildroot) for patch submission and review.
+            See [submitting your own patches](http://buildroot.org/manual.html#submitting-patches) for more info.
+
+            Thanks for your help!
+          lock-pr: true
+          close-pr: true
\ No newline at end of file
--

2.17.1

Quoted 4 lines
Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Hello,

Quoted 7 lines · On Mon, 8 Jul 2024 10:25:05 +0800 (GMT+08:00) DongdongZhang…
Quoted 6 lines

Can probably just use a github script along these lines or something:
https://github.com/sbabic/swupdate/blob/2024.05.2/.github/workflows/contributing.yml

probably also needs a conditional so it only runs on the one github repo:
if: github.repository == ‘buildroot/buildroot’

Quoted 8 lines

Hi, James,
In this scenario, I believe that using dessant/repo-lockdown@v4 is more suitable than actions/github-script@v5. dessant/repo-lockdown@v4 is specifically focused on repository lockdown functionality and has been widely used and validated. In contrast, while actions/github-script@v5 is flexible, it requires more customization and maintenance work and a strong familiarity with JavaScript. To keep the process simple and stable, I have decided to continue using dessant/repo-lockdown@v4.

I do agree with you on this. However, you didn't reply to the second comment from James, on checking that the action only runs on the main buildroot repo, and not others. Indeed, we don't want people/companies forking our repo to have this PR lockdown action triggered.

Could you check this, and send an updated version of your patch?

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
Quoted 31 lines

-----原始邮件-----发件人:"Thomas Petazzoni" <[email protected]>发送时间:2024-07-09 04:29:33 (星期二)收件人:DongdongZhang <[email protected]>抄送:"James Hilliard" <[email protected]>, [email protected], [email protected]主题:Re: [Buildroot] [PATCH v2 1/1] .github: add github action to automate PR handling

Hello,

Quoted 7 lines · On Mon, 8 Jul 2024 10:25:05 +0800 (GMT+08:00) DongdongZhang…
Quoted 6 lines

Can probably just use a github script along these lines or something:
https://github.com/sbabic/swupdate/blob/2024.05.2/.github/workflows/contributing.yml

probably also needs a conditional so it only runs on the one github repo:
if: github.repository == ‘buildroot/buildroot’

Quoted 8 lines

Hi, James,
In this scenario, I believe that using dessant/repo-lockdown@v4 is more suitable than actions/github-script@v5. dessant/repo-lockdown@v4 is specifically focused on repository lockdown functionality and has been widely used and validated. In contrast, while actions/github-script@v5 is flexible, it requires more customization and maintenance work and a strong familiarity with JavaScript. To keep the process simple and stable, I have decided to continue using dessant/repo-lockdown@v4.

I do agree with you on this. However, you didn't reply to the second comment from James, on checking that the action only runs on the main buildroot repo, and not others. Indeed, we don't want people/companies forking our repo to have this PR lockdown action triggered.

Quoted 9 lines

Could you check this, and send an updated version of your patch?

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com

Hello, Thomas.

I previously misunderstood James's response. Thanks to both James and your suggestions. I will update a patch version shortly to restrict the trigger condition to the repo buildroot/buildroot.

Thank you.

Dongdong
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot