-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.74 KB
/
create-post-from-remark-email.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This is a basic workflow that is manually triggered
name: Remarkable post from email
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
date:
description: 'Post date, formatted as yyyy/mm/dd'
required: true
type: string
slug:
description: 'Post slug'
required: true
type: string
title:
description: 'Post title'
required: true
type: string
frontmatter:
description: 'Markdown metadata header'
required: true
type: string
html:
description: 'Main post HTML'
required: true
type: string
jobs:
create-post:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Convert issue body to markdown
id: html_to_markdown
uses: "mashedkeyboard/action-html-to-markdown@main"
with:
html-text: ${{ inputs.html }}
- name: Checkout repo
uses: actions/checkout@v3
- name: Write file
uses: "DamianReeves/write-file-action@master"
with:
path: posts/${{ inputs.date }}/${{ inputs.slug }}.svx
write-mode: overwrite
contents: ${{ format('{0}{1}', inputs.frontmatter, steps.html_to_markdown.outputs.markdown-text) }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5.0.2
with:
commit-message: Adding blog post "${{ inputs.title }}" from email
title: ${{ inputs.title }}
branch: posts/${{ inputs.slug }}
assignees: mashedkeyboard
delete-branch: true