Skip to content
rayner.blog

Syncing Resume PDFs to GitHub Automatically

I got tired of exporting PDFs to my portfolio site, so I wrote a script to do it for me.
Dec 24, 2025 — Software Engineering
4 min read

Since it’s job hunting season for full-time opportunities in 2026, I find myself updating my resume pretty often. I often use Google Docs to edit my resume since it’s pretty convenient to track past versions with the change history and make quick tweaks on the fly.

However, I’ve always found it cumbersome to reflect the latest version of my resume on my portfolio site, since it involved this workflow:

  1. Export Google Docs resume as PDF
  2. Manually move that PDF to public directory in my portfolio site repo
  3. Git add, commit and push changes
  4. Wait for Vercel to redeploy so the site shows latest resume

Enter Google Apps Script

I decided to see if I could automate this task. I tinkered with Google Apps Script (GAS) — which is essentially JavaScript that runs on Google’s servers — to bridge the gap between my resume Google doc and my GitHub repo.

I managed to write a script that handles the entire pipeline:

  1. Create a temporary copy of my master resume (so I never mess with the original).
  2. Auto-redact sensitive info: It uses a Regex pattern to find my phone number and replace it with XXXXXXXXXXXX for the public version.
  3. Convert to PDF: It generates a fresh PDF blob directly in the script.
  4. Sync to GitHub: It checks my GitHub repo via the API. If the content has changed, it encodes the PDF to Base64 and pushes a commit directly to my public folder.

Avoiding commit spam

One thing I wanted to avoid was “spamming” my commit history with a daily commit, even if nothing in my resume actually changed. To solve this, the script fetches the current resume PDF file from the GitHub repo, converts it to Base64, and compares it against the new version. It only executes the PUT request if it detects a difference. If I haven’t changed my resume, the script just finishes its run quietly and wouldn’t commit anything to the repo.

// Fetch current file details from GitHub to check for changes
const currentFileResponse = UrlFetchApp.fetch(githubApiUrl, {
method: 'GET',
headers: headers,
muteHttpExceptions: true
});
if (currentFileResponse.getResponseCode() === 200) {
const currentFile = JSON.parse(currentFileResponse.getContentText());
const sha = currentFile.sha;
const currentFileContentBase64 = currentFile.content.replace(/\n/g, '');
// Only push if the new PDF is actually different
if (newFileContentBase64 === currentFileContentBase64) {
Logger.log('Content unchanged. Skipping commit.');
return;
}
}

Redacting sensitive info

I also didn’t want my personal phone number floating around in my portfolio site. Since the script creates a temporary copy of the Google doc anyway, I added a quick regex replacement to “hide” my contact info before the PDF is even generated.

// Create a temporary copy for safe editing
const tempDoc = tempFile.makeCopy(tempFolder);
const docCopy = DocumentApp.openById(tempDoc.getId());
const body = docCopy.getBody();
// Find my phone number pattern and swap it out
body.replaceText('\\+1\\s\\d{3}-\\d{3}-\\d{4}', 'XXXXXXXXXXXX');
docCopy.saveAndClose();

Setting it up

I set a Time-driven Trigger in the Google Apps Script dashboard. Now, every day at midnight, the script “wakes up,” checks if I’ve made any edits to my Google Doc, and syncs them to my portfolio automatically.

Conclusion

Now, my portfolio is always 100% in sync with my “source of truth.” When I finish a new project or reach a new milestone, I just type it into my Google Doc and walk away, knowing that by the end of the day my portfolio site will be updated by the next day.

It’s a small automation, but it removes that tiny bit of mental overhead during an already stressful job-hunting season. If you’re a student or a dev looking to automate your workflow, I’d highly recommend checking out Google Apps Script!

Here is the link (opens in a new window) to the repo if anyone wants to check it out!