Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/application-flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
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 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)
.replaceAll('${issue_number}', issue.number);
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 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 || '';
const regex = new RegExp(
`(?:resolves|closes):?\\s*(?:#(\\d+)|https:\\/\\/github\\.com\\/${owner}\\/${repo}\\/issues\\/(\\d+))`,
'mi'
);
const matches = [...prBody.matchAll(regex)];

// 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
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
state: 'open'
});

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: commentBody
});
} catch (error) {
console.log(`Could not reopen issue #${issue_number}: ${error.message}`);
}
}
1 change: 1 addition & 0 deletions .github/workflows/application-follow-up-body.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions .github/workflows/application-merged-body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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
75 changes: 40 additions & 35 deletions profile-submission.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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"
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -875,22 +875,22 @@
"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"
},
{
"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"
Expand All @@ -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": "Ananta",
"full_name": "HelloWorld",
"github_trial_issue_link": "https://github.com/holdex/trial/issues/1090"
}
]
}
}