From ddbfddcf73d27234584765a8bf7b692e36c9ef15 Mon Sep 17 00:00:00 2001 From: Dhanush Date: Sun, 24 Nov 2024 13:06:13 +0530 Subject: [PATCH 1/2] Updated NewPasswordPage.vue with password visibility toggle --- .../src/views/SignInPage/NewPasswordPage.vue | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/kolibri/plugins/user_auth/assets/src/views/SignInPage/NewPasswordPage.vue b/kolibri/plugins/user_auth/assets/src/views/SignInPage/NewPasswordPage.vue index 89ca49aaf4d..1a84d704a11 100644 --- a/kolibri/plugins/user_auth/assets/src/views/SignInPage/NewPasswordPage.vue +++ b/kolibri/plugins/user_auth/assets/src/views/SignInPage/NewPasswordPage.vue @@ -1,5 +1,4 @@ - - From c90f62d676df93203f6f06de7cc0681b9297b55e Mon Sep 17 00:00:00 2001 From: Dhanush Date: Thu, 26 Dec 2024 03:28:17 +0530 Subject: [PATCH 2/2] Add community-contribution-in-progress label action --- .github/actions/manage-label/action.yml | 15 ++++++++ .github/actions/manage-label/index.js | 48 +++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/actions/manage-label/action.yml create mode 100644 .github/actions/manage-label/index.js diff --git a/.github/actions/manage-label/action.yml b/.github/actions/manage-label/action.yml new file mode 100644 index 00000000000..8b3fbf350e5 --- /dev/null +++ b/.github/actions/manage-label/action.yml @@ -0,0 +1,15 @@ +name: 'Manage Labels for External Contributors' +description: 'Add or remove labels when external contributors are assigned or unassigned.' + +inputs: + github_token: + description: 'GitHub Token for authentication' + required: true + default: ${{ secrets.GITHUB_TOKEN }} + +runs: + using: 'python' + main: 'manage_labels.py' + +# Add other configuration based on your requirements + diff --git a/.github/actions/manage-label/index.js b/.github/actions/manage-label/index.js new file mode 100644 index 00000000000..d034efcf092 --- /dev/null +++ b/.github/actions/manage-label/index.js @@ -0,0 +1,48 @@ +const core = require('@actions/core'); +const github = require('@actions/github'); + +async function run() { + try { + const token = core.getInput('repo-token'); + const octokit = github.getOctokit(token); + const { context } = github; + + const issueNumber = context.issue.number; + const assignee = context.payload.assignee; + const owner = context.repo.owner; + const repo = context.repo.repo; + + // Check if the assignee is an external contributor (not a member or owner) + const { data: collaborators } = await octokit.rest.repos.listCollaborators({ + owner, + repo, + }); + + const isExternalContributor = !collaborators.some( + (collab) => collab.login === assignee.login && (collab.role === 'member' || collab.role === 'owner') + ); + + if (isExternalContributor) { + // Add the label + await octokit.rest.issues.addLabels({ + owner, + repo, + issue_number: issueNumber, + labels: ['community-contribution-in-progress'], + }); + } else { + // Remove the label + await octokit.rest.issues.removeLabel({ + owner, + repo, + issue_number: issueNumber, + name: 'community-contribution-in-progress', + }); + } + } catch (error) { + core.setFailed(error.message); + } +} + +run(); +