-
Notifications
You must be signed in to change notification settings - Fork 38
57 lines (48 loc) · 1.49 KB
/
git_am.yml
File metadata and controls
57 lines (48 loc) · 1.49 KB
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
name: Git AM Patch
on:
workflow_dispatch:
inputs:
msg_id:
description: 'Gmail Message ID'
required: true
target_branch:
description: 'Branch to apply patch to'
required: true
default: 'main'
jobs:
apply-patch:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.target_branch }}
persist-credentials: true
fetch-depth: 100
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install googleapis
- name: Set up Git
run: |
git config user.name "GitHub Action"
git config user.email "action@github.com"
- name: Download get_patch.js
run: |
mkdir -p scripts
curl -sSL https://raw.githubusercontent.com/jaegeuk/lore-feeds/main/scripts/get_patch.js > scripts/get_patch.js
- name: Get Patch
env:
GMAIL_CLIENT_ID: ${{ secrets.GMAIL_CLIENT_ID }}
GMAIL_CLIENT_SECRET: ${{ secrets.GMAIL_CLIENT_SECRET }}
GMAIL_REFRESH_TOKEN: ${{ secrets.GMAIL_REFRESH_TOKEN }}
run: |
node scripts/get_patch.js ${{ github.event.inputs.msg_id }} > patch.txt
- name: Apply Patch
run: |
git am patch.txt
- name: Push changes
run: |
git push origin ${{ github.event.inputs.target_branch }}