-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.27 KB
/
sync-sendgrid-template-action.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
on:
workflow_call:
inputs:
FORCE_SYNC_ALL:
required: false
type: string
secrets:
SENDGRID_API_KEY:
required: true
jobs:
sendgrid_sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: SendGrid sync
id: sendgrid_sync
uses: nanopx/action-sendgrid-sync@0.5.2
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
sendgridApiKey: ${{ secrets.SENDGRID_API_KEY }}
templatesDir: 'emailTemplates/'
forceSyncAll: '${{ inputs.FORCE_SYNC_ALL }}'
- name: Write template id mapping
uses: DamianReeves/write-file-action@master
with:
path: src/api/templateIdMapping.json
contents: ${{ steps.sendgrid_sync.outputs.sendgridTemplateIdMapping }}
write-mode: overwrite
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Commit & Push
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.extract_branch.outputs.branch }}
outputFile: 'src/api/templateIdMapping.json'