Skip to content

Instantly share code, notes, and snippets.

{
"event": "push",
"payload": {
"ref": "refs/heads/some-branch",
"before": "a23a73088bb8d69c89abcfece9a91d4e539aed7e",
"after": "52f7e61280c44756691959a11e6970bf153c8ba6",
"repository": {
"id": 243290722,
"node_id": "MDEwOlJlcG9zaXRvcnkyNDMyOTA3MjI=",
"name": "Spoon-Knife",
@swinton
swinton / self-hosted-runners-playground.md
Created February 25, 2020 17:08
Programmatically create a self-hosted runner
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:CreateInstanceProfile",
"iam:DeleteInstanceProfile",
"iam:GetRole",
"iam:GetInstanceProfile",
@swinton
swinton / prepare-release-branch.yml
Last active October 30, 2019 23:44
Sync release branch with master on every push to master, and include productionized node_modules folder on release
name: Prepare Release Branch
on:
push:
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- master # triggers on pushes that contain changes in master
jobs:
prepare-release-branch:
name: Prepare Release Branch
# eks.yml
on:
pull_request:
push:
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- master # triggers on pushes that contain changes in master
name: Build and Deploy to EKS
env:
const fs = require('fs');
const readline = require('readline');
const {google} = require('googleapis');
// If modifying these scopes, delete credentials.json.
const SCOPES = ['https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.send'];
const TOKEN_PATH = 'credentials.json';
// Load client secrets from a local file.
fs.readFile('client_secret.json', (err, content) => {
INSTALLATION_TOKEN= # Your installation access token
{
"_links": {
"comments": {
"href": "https://api.github.com/repos/swinton/example/issues/2/comments"
},
"commits": {
"href": "https://api.github.com/repos/swinton/example/pulls/2/commits"
},
"html": {
"href": "https://github.com/swinton/example/pull/2"
/**
* See: https://support.insomnia.rest/article/26-plugins#template-tags
*/
const fs = require('fs')
const jwt = require('jsonwebtoken')
//
const createApp = function ({id, cert}) {
return function () {
const payload = {
iat: Math.floor(new Date() / 1000), // Issued at time