Skip to content

Commit 4b4b9b2

Browse files
committed
Update files and add hiring workflow
1 parent bedc04a commit 4b4b9b2

File tree

7 files changed

+373
-9
lines changed

7 files changed

+373
-9
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Mirror hiring issues to private repo and delete public copy
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
contents: read
9+
issues: write
10+
11+
jobs:
12+
mirror-and-delete:
13+
# Only act on issues marked as hiring/candidate
14+
if: |
15+
contains(join(github.event.issue.labels.*.name, ','), 'hiring') ||
16+
contains(join(github.event.issue.labels.*.name, ','), 'candidate')
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Install jq
21+
run: sudo apt-get update && sudo apt-get install -y jq
22+
23+
- name: Mirror to private repo and delete public issue
24+
env:
25+
GH_TOKEN: ${{ secrets.HIRING_REPO_TOKEN }}
26+
27+
SOURCE_OWNER: platformbuilds
28+
SOURCE_REPO: platformbuilds.github.io
29+
30+
TARGET_OWNER: platformbuilds
31+
TARGET_REPO: hiring
32+
33+
ISSUE_NUMBER: ${{ github.event.issue.number }}
34+
run: |
35+
set -euo pipefail
36+
37+
echo "Fetching source issue #${ISSUE_NUMBER}…"
38+
39+
issue_json=$(curl -sSL \
40+
-H "Authorization: Bearer ${GH_TOKEN}" \
41+
-H "Accept: application/vnd.github+json" \
42+
"https://api.github.com/repos/${SOURCE_OWNER}/${SOURCE_REPO}/issues/${ISSUE_NUMBER}")
43+
44+
title=$(echo "$issue_json" | jq -r '.title')
45+
body=$(echo "$issue_json" | jq -r '.body')
46+
author=$(echo "$issue_json" | jq -r '.user.login')
47+
node_id=$(echo "$issue_json" | jq -r '.node_id')
48+
49+
echo "Source title: $title"
50+
echo "Source author: $author"
51+
echo "Source node_id: $node_id"
52+
53+
private_body=$(cat <<EOF
54+
Application submitted via website → public intake issue → mirrored by GitHub Actions.
55+
56+
**Original author:** @${author}
57+
**Original issue (now deleted):** https://github.com/${SOURCE_OWNER}/${SOURCE_REPO}/issues/${ISSUE_NUMBER}
58+
59+
---
60+
61+
${body}
62+
EOF
63+
)
64+
65+
create_payload=$(jq -n \
66+
--arg title "$title" \
67+
--arg body "$private_body" \
68+
'{
69+
title: $title,
70+
body: $body,
71+
labels: ["candidate", "source:public-intake"]
72+
}')
73+
74+
echo "Creating issue in ${TARGET_OWNER}/${TARGET_REPO}…"
75+
76+
create_resp=$(curl -sSL \
77+
-X POST \
78+
-H "Authorization: Bearer ${GH_TOKEN}" \
79+
-H "Accept: application/vnd.github+json" \
80+
"https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/issues" \
81+
-d "$create_payload")
82+
83+
private_issue_url=$(echo "$create_resp" | jq -r '.html_url')
84+
echo "Private issue created at: $private_issue_url"
85+
86+
# Optional scrub+close before deletion (defence in depth)
87+
scrubbed_body="Thanks for applying! Your application has been recorded in our internal hiring tracker."
88+
89+
update_payload=$(jq -n \
90+
--arg body "$scrubbed_body" \
91+
'{
92+
body: $body,
93+
state: "closed"
94+
}')
95+
96+
echo "Scrubbing and closing source issue before deletion…"
97+
98+
curl -sSL \
99+
-X PATCH \
100+
-H "Authorization: Bearer ${GH_TOKEN}" \
101+
-H "Accept: application/vnd.github+json" \
102+
"https://api.github.com/repos/${SOURCE_OWNER}/${SOURCE_REPO}/issues/${ISSUE_NUMBER}" \
103+
-d "$update_payload"
104+
105+
# Delete via GraphQL
106+
echo "Deleting source issue via GraphQL…"
107+
108+
graphql_query=$(jq -n \
109+
--arg id "$node_id" \
110+
'{ query: "mutation DeleteIssue($id:ID!){ deleteIssue(input:{issueId:$id}){ clientMutationId }}", variables: { id: $id } }')
111+
112+
delete_resp=$(curl -sSL \
113+
-X POST \
114+
-H "Authorization: Bearer ${GH_TOKEN}" \
115+
-H "Accept: application/vnd.github+json" \
116+
https://api.github.com/graphql \
117+
-d "$graphql_query")
118+
119+
echo "Delete response:"
120+
echo "$delete_resp"
121+
122+
echo "Done: mirrored to private and deleted public issue."

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source "https://rubygems.org"
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
gem "jekyll", "~> 4.3.0"
4+
gem "jekyll", "~> 4.3.3"
55
gem "webrick", "~> 1.7"
66

77
group :jekyll_plugins do

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ PLATFORMS
8989
x86_64-linux
9090

9191
DEPENDENCIES
92-
jekyll (~> 4.3.0)
92+
jekyll (~> 4.3.3)
9393
jekyll-paginate-v2
9494
jekyll-seo-tag
9595
jekyll-sitemap
@@ -99,4 +99,4 @@ DEPENDENCIES
9999
webrick (~> 1.7)
100100

101101
BUNDLED WITH
102-
2.6.6
102+
2.3.27

_config.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ social:
5454
navigation:
5555
- name: Home
5656
url: /
57-
- name: About
58-
url: /about/
5957
- name: Products
6058
url: /products/
6159
- name: Projects
@@ -67,6 +65,13 @@ navigation:
6765
url: /projects/miradorstack/
6866
- name: Platform Engineering
6967
url: /projects/platform-engineering/
68+
- name: Company
69+
url: /about/
70+
children:
71+
- name: About
72+
url: /about/
73+
- name: Hiring
74+
url: /hiring/
7075
- name: Community
7176
url: https://github.com/orgs/platformbuilds/discussions
7277
- name: Blog

assets/css/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ nav {
442442

443443
.nav-links {
444444
display: flex;
445-
gap: 2rem;
445+
gap: 1.5rem;
446446
align-items: center;
447447
position: relative;
448448
z-index: 100;
@@ -770,7 +770,7 @@ nav {
770770
}
771771

772772
.btn-header {
773-
padding: 1rem 3.5rem !important;
773+
padding: 0.75rem 2rem !important;
774774
}
775775

776776
.btn-secondary {

assets/js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ function initMobileMenu() {
149149
mobileMenuButton.addEventListener('touchstart', handleMobileMenuClick);
150150
mobileMenuButton.addEventListener('click', handleMobileMenuClick);
151151

152-
// Close menu when clicking on a link
153-
const mobileLinks = mobileMenu.querySelectorAll('a');
152+
// Close menu when clicking on a link (but not dropdown toggles)
153+
const mobileLinks = mobileMenu.querySelectorAll('a:not(.mobile-dropdown-toggle)');
154154
mobileLinks.forEach(link => {
155155
link.addEventListener('click', function() {
156156
mobileMenu.classList.remove('active');

0 commit comments

Comments
 (0)