Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow actions to write in serial monitor repo #14

Closed
wants to merge 1 commit into from

Conversation

thegecko
Copy link
Contributor

@thegecko thegecko commented Feb 9, 2024

Re: #13 (comment)

As expected, read only access for GitHub actions means it cannot create a release entry on GitHub during a release build :(

https://github.com/eclipse-cdt-cloud/vscode-serial-monitor/actions/runs/7847423210

This PR allows the action to write the release.

cc @netomi

Allow actions to write

Signed-off-by: Rob Moran <[email protected]>
@thegecko thegecko requested review from a team as code owners February 9, 2024 17:29
Copy link

github-actions bot commented Feb 9, 2024

Diff for 7756cde:
Printing local diff:

Actions are indicated with the following symbols:
+   create
!   modify
!   forced update
-   delete

Organization ecd.cdt-cloud[id=eclipse-cdt-cloud]
  there have been 7 validation infos, enable verbose output with '-v' to to display them.

  
!   repo_workflow_settings[repository="vscode-serial-monitor"] {
!     default_workflow_permissions      = "read" -> "write"
!   }
  
  Plan: 0 to add, 1 to change, 0 to delete.
Canonical Diff for 7756cde:
Showing canonical diff:

Organization ecd.cdt-cloud[id=eclipse-cdt-cloud]

--- canonical
+++ original
@@ -1,16 +1,13 @@
 local orgs = import 'vendor/otterdog-defaults/otterdog-defaults.libsonnet';
 
-local custom_branch_protection_rule(pattern) = 
-  orgs.newBranchProtectionRule(pattern) {
-
-    required_approving_review_count: 0
-  };
 orgs.newOrg('eclipse-cdt-cloud') {
   _repositories+:: [
     orgs.newRepo('cdt-amalgamator') {
       allow_update_branch: false
       branch_protection_rules: [
-        custom_branch_protection_rule('main')
+        orgs.newBranchProtectionRule('main') {
+          required_approving_review_count: 0
+        }
       ]
       delete_branch_on_merge: false
       web_commit_signoff_required: false
@@ -56,7 +53,9 @@
     orgs.newRepo('cdt-gdb-adapter') {
       allow_update_branch: false
       branch_protection_rules: [
-        custom_branch_protection_rule('main')
+        orgs.newBranchProtectionRule('main') {
+          required_approving_review_count: 0
+        }
       ]
       delete_branch_on_merge: false
       dependabot_security_updates_enabled: true
@@ -75,7 +74,9 @@
     orgs.newRepo('cdt-gdb-vscode') {
       allow_update_branch: false
       branch_protection_rules: [
-        custom_branch_protection_rule('main')
+        orgs.newBranchProtectionRule('main') {
+          required_approving_review_count: 0
+        }
       ]
       delete_branch_on_merge: false
       dependabot_security_updates_enabled: true
@@ -293,13 +294,10 @@
           requires_strict_status_checks: true
         }
       ]
-      default_branch: "main"
-      delete_branch_on_merge: true
       description: "Fork of the VS Code extension for clangd with added support for multiple projects"
-      forked_repository: "clangd/vscode-clangd"
       homepage: "https://eclipse.dev/cdt-cloud"
-      topics: [
-        "clangd", 
+      topics+: [
+        "clangd"
         "vscode-extension"
       ]
       web_commit_signoff_required: false
@@ -307,7 +305,6 @@
     orgs.newRepo('vscode-memory-inspector') {
       allow_merge_commit: true
       allow_update_branch: false
-      delete_branch_on_merge: true
       description: "vscode memory inspector"
       homepage: "https://open-vsx.org/extension/eclipse-cdt/memory-inspector"
       web_commit_signoff_required: false
@@ -316,10 +313,8 @@
       }
     }
     orgs.newRepo('vscode-peripheral-inspector') {
-      aliases: ['vscode-svd-viewer']
       allow_merge_commit: true
       allow_update_branch: false
-      delete_branch_on_merge: true
       description: "vscode peripheral inspector"
       homepage: "https://open-vsx.org/extension/eclipse-cdt/peripheral-inspector"
       web_commit_signoff_required: false
@@ -330,7 +325,6 @@
     orgs.newRepo('vscode-serial-monitor') {
       allow_merge_commit: true
       allow_update_branch: false
-      delete_branch_on_merge: true
       description: "vscode serial monitor"
       homepage: "https://open-vsx.org/extension/eclipse-cdt/serial-monitor"
       web_commit_signoff_required: false
@@ -394,7 +388,6 @@
     orgs.newRepo('vscode-websocket-adapter') {
       allow_merge_commit: true
       allow_update_branch: false
-      delete_branch_on_merge: true
       description: "vscode websocket adapter"
       has_wiki: false
       homepage: "https://open-vsx.org/extension/eclipse-cdt/websocket-adapter"

@netomi
Copy link
Contributor

netomi commented Feb 9, 2024

If you add the permissions to the release job as described in the action it should work:

https://github.com/softprops/action-gh-release?tab=readme-ov-file#permissions

@thegecko
Copy link
Contributor Author

If you add the permissions to the release job ... it should work:

Great! I wasn't aware of that and it works. I've taken the liberty of reflecting this in the other repos I manage:

#15

@thegecko thegecko closed this Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants