From 0d6201277a31a8a9b74fdaf896b8b4217a58e1f3 Mon Sep 17 00:00:00 2001 From: Ananta98 Date: Wed, 4 Mar 2026 21:15:36 +0700 Subject: [PATCH 1/7] feat: add github workflow for job applications --- .github/workflows/application-flow.yml | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/application-flow.yml diff --git a/.github/workflows/application-flow.yml b/.github/workflows/application-flow.yml new file mode 100644 index 0000000..af19d2b --- /dev/null +++ b/.github/workflows/application-flow.yml @@ -0,0 +1,68 @@ +name: Application Flow + +on: + issues: + types: [opened] + pull_request: + types: [closed] + +jobs: + ask-for-pr: + if: github.event_name == 'issues' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Comment with PR instructions + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issue = context.payload.issue; + const candidate = issue.user.login; + const commentBody = `Hi @${candidate} — thanks for applying! Please add your profile by opening a pull request that adds a JSON file with your profile under profile-submission.json. In your PR description include "resolves: #${issue.number}" or "closes: #${issue.number}" so we can link it to this application. Once your PR is merged we'll reopen this issue and ask you to proceed with the trial task.`; + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.issue.number, + body: commentBody + }); + try { + await github.rest.issues.addLabels({ ...context.repo, issue_number: issue.number, labels: ['job-application'] }); + } catch (e) { + console.log('Could not add label:', e.message); + } + + reopen-issue: + if: github.event_name == 'pull_request' && github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Reopen linked issues and ask to proceed + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const prBody = context.payload.pull_request.body || ''; + const regex = /(?:resolves|closes):?\s*(?:#|https:\/\/github\.com\/[^\/]+\/[^\/]+\/issues\/)(\d+)/gi;; + const matches = [...prBody.matchAll(regex)]; + + // Extract the numbers and remove duplicates + const issueNumbers = [...new Set(matches.map(m => parseInt(m[1], 10)))]; + + for (const issue_number of issueNumbers) { + try { + // The actual command to reopen + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue_number, + state: 'open' + }); + } catch (error) { + console.log(`Could not reopen issue #${issue_number}: ${error.message}`); + } + } From d367b00deba7d4bb857b4b5fee81cc0384275153 Mon Sep 17 00:00:00 2001 From: Ananta98 Date: Thu, 5 Mar 2026 19:25:10 +0700 Subject: [PATCH 2/7] fix: fix based on coderabbit suggestions --- .github/workflows/application-flow.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/application-flow.yml b/.github/workflows/application-flow.yml index af19d2b..6c12ddf 100644 --- a/.github/workflows/application-flow.yml +++ b/.github/workflows/application-flow.yml @@ -47,11 +47,14 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const prBody = context.payload.pull_request.body || ''; - const regex = /(?:resolves|closes):?\s*(?:#|https:\/\/github\.com\/[^\/]+\/[^\/]+\/issues\/)(\d+)/gi;; + const regex = new RegExp( + `(?:resolves|closes):?\\s*(?:#(\\d+)|https:\\/\\/github\\.com\\/${owner}\\/${repo}\\/issues\\/(\\d+))`, + 'gi' + ); const matches = [...prBody.matchAll(regex)]; // Extract the numbers and remove duplicates - const issueNumbers = [...new Set(matches.map(m => parseInt(m[1], 10)))]; + const issueNumbers = [...new Set(matches.map(m => parseInt(m[1] || m[2], 10)))]; for (const issue_number of issueNumbers) { try { @@ -62,6 +65,13 @@ jobs: issue_number: issue_number, state: 'open' }); + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue_number, + body: `Hi @${context.payload.pull_request.user.login} — your profile PR was merged. Please proceed with the trial task.` + }); } catch (error) { console.log(`Could not reopen issue #${issue_number}: ${error.message}`); } From e91ee89a984e7082a9f89726ac616a17d286a1ab Mon Sep 17 00:00:00 2001 From: Ananta98 Date: Thu, 5 Mar 2026 19:37:38 +0700 Subject: [PATCH 3/7] fix: fix undefine owner and repo --- .github/workflows/application-flow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/application-flow.yml b/.github/workflows/application-flow.yml index 6c12ddf..4aae1f2 100644 --- a/.github/workflows/application-flow.yml +++ b/.github/workflows/application-flow.yml @@ -46,6 +46,8 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | + const owner = context.repo.owner.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const repo = context.repo.repo.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); const prBody = context.payload.pull_request.body || ''; const regex = new RegExp( `(?:resolves|closes):?\\s*(?:#(\\d+)|https:\\/\\/github\\.com\\/${owner}\\/${repo}\\/issues\\/(\\d+))`, From e9856e7411f1df48acdcdc80ee8b5c28a276c0c4 Mon Sep 17 00:00:00 2001 From: Ananta98 Date: Fri, 6 Mar 2026 19:56:34 +0700 Subject: [PATCH 4/7] fix: use md file to show comment github bot --- .github/workflows/application-flow.yml | 18 ++++++++++++++++-- .../workflows/application-follow-up-body.md | 1 + .github/workflows/application-merged-body.md | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/application-follow-up-body.md create mode 100644 .github/workflows/application-merged-body.md diff --git a/.github/workflows/application-flow.yml b/.github/workflows/application-flow.yml index 4aae1f2..8cb4924 100644 --- a/.github/workflows/application-flow.yml +++ b/.github/workflows/application-flow.yml @@ -19,9 +19,15 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | + const fs = require('fs'); + const path = require('path'); + const issue = context.payload.issue; + const candidate = issue.user.login; + const workspace = process.env.GITHUB_WORKSPACE; + const commentBody = fs.readFileSync(path.join(workspace, '.github/workflows/application-follow-up-body.md'), 'utf8') + .replace('${candidate}', candidate); const issue = context.payload.issue; const candidate = issue.user.login; - const commentBody = `Hi @${candidate} — thanks for applying! Please add your profile by opening a pull request that adds a JSON file with your profile under profile-submission.json. In your PR description include "resolves: #${issue.number}" or "closes: #${issue.number}" so we can link it to this application. Once your PR is merged we'll reopen this issue and ask you to proceed with the trial task.`; await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, @@ -46,6 +52,8 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | + const fs = require('fs'); + const path = require('path'); const owner = context.repo.owner.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); const repo = context.repo.repo.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); const prBody = context.payload.pull_request.body || ''; @@ -58,6 +66,12 @@ jobs: // Extract the numbers and remove duplicates const issueNumbers = [...new Set(matches.map(m => parseInt(m[1] || m[2], 10)))]; + // use md file + const workspace = process.env.GITHUB_WORKSPACE; + const user = context.payload.pull_request.user.login + const commentBody = fs.readFileSync(path.join(workspace, '.github/workflows/application-merged-body.md'), 'utf8') + .replace('${user}', user); + for (const issue_number of issueNumbers) { try { // The actual command to reopen @@ -72,7 +86,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: issue_number, - body: `Hi @${context.payload.pull_request.user.login} — your profile PR was merged. Please proceed with the trial task.` + body: commentBody }); } catch (error) { console.log(`Could not reopen issue #${issue_number}: ${error.message}`); diff --git a/.github/workflows/application-follow-up-body.md b/.github/workflows/application-follow-up-body.md new file mode 100644 index 0000000..411ac50 --- /dev/null +++ b/.github/workflows/application-follow-up-body.md @@ -0,0 +1 @@ +Hi @${candidate} — thanks for applying! Please add your profile by opening a pull request that adds a JSON file with your profile under profile-submission.json. In your PR description include "resolves: #${issue.number}" or "closes: #${issue.number}" so we can link it to this application. Once your PR is merged we'll reopen this issue and ask you to proceed with the trial task. diff --git a/.github/workflows/application-merged-body.md b/.github/workflows/application-merged-body.md new file mode 100644 index 0000000..521b2f4 --- /dev/null +++ b/.github/workflows/application-merged-body.md @@ -0,0 +1 @@ +Hi @${user} — your profile PR was merged. Please proceed with the trial task. From 9f8c933e3d75484791a39c50615358c88b7d942a Mon Sep 17 00:00:00 2001 From: Ananta98 Date: Fri, 6 Mar 2026 20:02:09 +0700 Subject: [PATCH 5/7] fix: fix broken application-flow.yml and add link --- .github/workflows/application-flow.yml | 1 - .github/workflows/application-merged-body.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/application-flow.yml b/.github/workflows/application-flow.yml index 8cb4924..43c8ed6 100644 --- a/.github/workflows/application-flow.yml +++ b/.github/workflows/application-flow.yml @@ -26,7 +26,6 @@ jobs: const workspace = process.env.GITHUB_WORKSPACE; const commentBody = fs.readFileSync(path.join(workspace, '.github/workflows/application-follow-up-body.md'), 'utf8') .replace('${candidate}', candidate); - const issue = context.payload.issue; const candidate = issue.user.login; await github.rest.issues.createComment({ owner: context.repo.owner, diff --git a/.github/workflows/application-merged-body.md b/.github/workflows/application-merged-body.md index 521b2f4..5613695 100644 --- a/.github/workflows/application-merged-body.md +++ b/.github/workflows/application-merged-body.md @@ -1 +1 @@ -Hi @${user} — your profile PR was merged. Please proceed with the trial task. +Hi @${user} — your profile PR was merged. Please proceed with the trial task via link: https://github.com/holdex/trial/issues?q=is%3Aissue%20state%3Aopen%20label%3Atrial-task From c454c04ebc945488fd885d09a538a1c27fa56ed0 Mon Sep 17 00:00:00 2001 From: Ananta98 Date: Fri, 6 Mar 2026 20:05:25 +0700 Subject: [PATCH 6/7] fix: fix double variable candidate --- .github/workflows/application-flow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/application-flow.yml b/.github/workflows/application-flow.yml index 43c8ed6..558e14c 100644 --- a/.github/workflows/application-flow.yml +++ b/.github/workflows/application-flow.yml @@ -26,7 +26,6 @@ jobs: const workspace = process.env.GITHUB_WORKSPACE; const commentBody = fs.readFileSync(path.join(workspace, '.github/workflows/application-follow-up-body.md'), 'utf8') .replace('${candidate}', candidate); - const candidate = issue.user.login; await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, From 53d502d82d87b8ef771822eb3c07a57ad49ac997 Mon Sep 17 00:00:00 2001 From: Ananta98 Date: Fri, 6 Mar 2026 20:07:15 +0700 Subject: [PATCH 7/7] test9 --- profile-submission.json | 75 ++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/profile-submission.json b/profile-submission.json index 359efe1..5ca3be7 100644 --- a/profile-submission.json +++ b/profile-submission.json @@ -19,7 +19,7 @@ "github_handle": "samiksha-kushwah", "full_name": "Samiksha Kushwah", "github_trial_issue_link": "https://github.com/holdex/trial/issues/714" - }, + }, { "github_handle": "VasishtGR", "full_name": "Vasisht G R", @@ -296,9 +296,9 @@ "github_trial_issue_link": "https://github.com/holdex/trial/issues/241" }, { - "github_handle": "piyushuiux", - "full_name": "Piyush Raj Singh", - "github_trial_issue_link": "https://github.com/holdex/trial/issues/478" + "github_handle": "piyushuiux", + "full_name": "Piyush Raj Singh", + "github_trial_issue_link": "https://github.com/holdex/trial/issues/478" }, { "github_handle": "ddadekunle", @@ -316,15 +316,15 @@ "github_trial_issue_link": "https://github.com/holdex/trial/issues/306" }, { - "github_handle": "Productguy1", - "full_name": "Daniel Mbazu", - "github_trial_issue_link": "https://github.com/holdex/trial/issues/285" + "github_handle": "Productguy1", + "full_name": "Daniel Mbazu", + "github_trial_issue_link": "https://github.com/holdex/trial/issues/285" }, { "github_handle": "pandablue0809", "full_name": "Riku Kodama", "github_trial_issue_link": "https://github.com/holdex/trial/issues/82" - }, + }, { "github_handle": "dokiugit", "full_name": "Dhokhiy Mustofa Akbar", @@ -356,9 +356,9 @@ "github_trial_issue_link": "https://github.com/holdex/trial/issues/395" }, { - "github_handle": "jingyi2811", - "full_name": "Lee Jing-yi", - "github_trial_issue_link": "https://github.com/holdex/trial/issues/380" + "github_handle": "jingyi2811", + "full_name": "Lee Jing-yi", + "github_trial_issue_link": "https://github.com/holdex/trial/issues/380" }, { "github_handle": "iiihsy", @@ -385,13 +385,13 @@ "full_name": "Filipe Rey Guimaraes dos Santos", "github_trial_issue_link": "https://github.com/holdex/trial/issues/416" }, - { - "github_handle": "mikaelowenn", + { + "github_handle": "mikaelowenn", "full_name": "Mikael Owen", "github_trial_issue_link": "https://github.com/holdex/trial/issues/397" - }, + }, { - "github_handle": "MuhammadZarq13", + "github_handle": "MuhammadZarq13", "full_name": "Muhammad Zarq Khan", "github_trial_issue_link": "https://github.com/holdex/trial/issues/438" }, @@ -484,7 +484,7 @@ "github_handle": "lilithkk", "full_name": "Jing Lin", "github_trial_issue_link": "https://github.com/holdex/trial/issues/579" - }, + }, { "github_handle": "martins87", "full_name": "Daniel Martins", @@ -524,8 +524,8 @@ "github_handle": "jaibhedia", "full_name": "Shantanu Swami", "github_trial_issue_link": "https://github.com/holdex/trial/issues/680" - }, - { + }, + { "github_handle": "roars2121", "full_name": "Ruairidh Orr Ewing", "github_trial_issue_link": "https://github.com/holdex/trial/issues/645" @@ -579,7 +579,7 @@ "github_handle": "ASKLTON", "full_name": "Alston Lantian Xu", "github_trial_issue_link": "https://github.com/holdex/trial/issues/694" - }, + }, { "github_handle": "RaamPujangga", "full_name": "Raam Pujangga Sadewa", @@ -610,7 +610,7 @@ "full_name": "Lkhamsuren Jargalsaikhan", "github_trial_issue_link": "https://github.com/holdex/trial/issues/726" }, - { + { "github_handle": "siddharth-09", "full_name": "Siddharth Panchal", "github_trial_issue_link": "https://github.com/holdex/trial/issues/708" @@ -655,7 +655,7 @@ "full_name": "Andika Leonardo Surya", "github_trial_issue_link": "https://github.com/holdex/trial/issues/235" }, - { + { "github_handle": "Doziiie", "full_name": "Chiedozie Nwaka", "github_trial_issue_link": "https://github.com/holdex/trial/issues/526" @@ -668,7 +668,7 @@ { "github_handle": "Goeter", "full_name": "Jason Vianney", - "github_trial_issue_link": "https://github.com/holdex/trial/issues/795" + "github_trial_issue_link": "https://github.com/holdex/trial/issues/795" }, { "github_handle": "jpdelostrinos", @@ -824,7 +824,7 @@ "github_handle": "HimanshuJain04", "full_name": "Himanshu Jain", "github_trial_issue_link": "https://github.com/holdex/trial/issues/975" - }, + }, { "github_handle": "cryptox427", "full_name": "Sudais Budhathoki", @@ -875,13 +875,13 @@ "full_name": "Nastasha Primera", "github_trial_issue_link": "https://github.com/holdex/trial/issues/1039" }, - { - "github_handle": "Nikhil8400", + { + "github_handle": "Nikhil8400", "full_name": "Nikhil Pandey", "github_trial_issue_link": "https://github.com/holdex/trial/issues/439" }, - { - "github_handle": "zzzLydia", + { + "github_handle": "zzzLydia", "full_name": "Zezheng Zhang", "github_trial_issue_link": "https://github.com/holdex/trial/issues/1044" }, @@ -889,8 +889,8 @@ "github_handle": "Nightowl1905", "full_name": "Dom Lai", "github_trial_issue_link": "https://github.com/holdex/trial/issues/1038" - }, - { + }, + { "github_handle": "arishtj", "full_name": "Arisht Jain", "github_trial_issue_link": "https://github.com/holdex/trial/issues/675" @@ -900,10 +900,15 @@ "full_name": "Ananta Kusuma P", "github_trial_issue_link": "https://github.com/holdex/trial/issues/1095" }, - { - "github_handle": "forvy", - "full_name": "Theodore Widjaja", - "github_trial_issue_link": "https://github.com/holdex/trial/issues/1090" - }, + { + "github_handle": "forvy", + "full_name": "Theodore Widjaja", + "github_trial_issue_link": "https://github.com/holdex/trial/issues/1090" + }, + { + "github_handle": "Test9", + "full_name": "Test9", + "github_trial_issue_link": "https://github.com/holdex/trial/issues/1090" + } ] -} \ No newline at end of file +}