Skip to content

Instantly share code, notes, and snippets.

View danieljin's full-sized avatar

Daniel Jin danieljin

View GitHub Profile
@danieljin
danieljin / appScript.js
Last active June 13, 2023 20:17
don't include inprogress builds
// New Commit
function newCommit(steps){
if (steps.trigger.event.body.push.changes[0].closed){
return []
}
const title = !steps.trigger.event.body.push.changes[0].created ? "New commit(s) pushed" : "New branch created";
const commitCount = parseInt(steps.trigger.event.body.push.changes[0].commits.length);
const commitText = commitCount >= 5 ? `${commitCount}+ commits` : `${commitCount} commit${commitCount > 1 ? 's' : ''}`;
const branchUrl = `${steps.trigger.event.body.repository.links.html.href}/branch/${steps.trigger.event.body.push.changes[0].new.name}`;
@danieljin
danieljin / appScript.js
Last active November 29, 2022 23:01
Slack Google Calendar for Team Events Replacement using Googgle App Scripts
// google configs
const calendarID = 'XXXXXXXX@import.calendar.google.com';
// slack configs
const webhookUrl = 'https://hooks.slack.com/services/XXXXXX/YYYYYYY/ZZZZZZ';
const channel = '#xxx'
const username = 'XXXXXX'
// note: this can be cleaned up but wanted to get something quick and dirty out there.
// throw this in a new App Script on https://script.google.com and have it trigger to run once a day.