This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Always Sam | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
respond_with_sam: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: lob/action_sam_jackson@0.0.2 | |
with: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const github = require("@actions/github") | |
const core = require("@actions/core") | |
const { Octokit } = require("@octokit/action"); | |
let gifURLs = [ | |
'https://c.tenor.com/p29xMArwXB8AAAAd/samuel-l-jackson-silly.gif', //silly face sam | |
'https://c.tenor.com/8aKkFuCN7TsAAAAC/samuel-l-jackson-snakes-on-a-plane.gif', //snakes on a plane | |
'https://c.tenor.com/PUw8yTi8V5AAAAAC/samuel-l-jackson-shocked.gif', //oh-really-sam?! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Sam Jackson Greeter' | |
description: 'An action to greet people who interact with the repo with a gif of Samuel L. Jackson' | |
inputs: | |
message: | |
description: 'Message displayed along side the Samuel L Jackson gif' | |
required: true | |
default: 'You need some Sam Jackson in your life' | |
token: | |
description: 'Github secret token' | |
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Current Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
name: Build and release new version to NPM | |
runs-on: ubuntu-latest | |
steps: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [pull_request] | |
jobs: | |
build: | |
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node: ['10.x', '12.x', '14.x'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import callback from "./postcard/callback.js"; | |
router.post("/postcard/callback", callback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function callback(req, res) { | |
const eventType = req.body.event_type.id; | |
const from = req.body.body.to.name; | |
const to = req.body.body.from.name; | |
switch (eventType) { | |
case "postcard.created": | |
case "postcard.deleted": | |
// update the billing software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<!-- other code --> | |
<ul> | |
<li v-for="postcard in postcards"> | |
<span v-if="postcard.from != null"> | |
From {{ postcard.from.name }} to {{ postcard.to.name }}. | |
</span> | |
<span v-else> | |
From *Address Missing* to {{ postcard.to.name }}. | |
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
// other code | |
function cancel(id) { | |
fetch(`http://localhost:3030/postcard/cancel/${id}`) | |
.then((data) => data.json()) | |
.then((data) => { | |
if (data.deleted) { | |
postcards.value = postcards.value.filter(postcard => postcard.id !== id) | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<ul> | |
<li v-for="postcard in postcards"> | |
<span v-if="postcard.from != null"> | |
From {{ postcard.from.name }} to {{ postcard.to.name }}. | |
</span> | |
<span v-else> | |
From *Address Missing* to {{ postcard.to.name }}. | |
</span> | |
<span v-if="canCancel(postcard.send_date)" class="cancel">Cancel</span> |
NewerOlder