-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.67 KB
/
update-youtube.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
name: Youtube Daily Pull
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Runs daily at midnight UTC
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
- name: Update-YoutubeChannelData
shell: pwsh
run: ./.powershell/build/Update-YoutubeChannelData.ps1
env:
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
GOOGLE_ACCESS_TOKEN: ${{ secrets.GOOGLE_ACCESS_TOKEN }}
GOOGLE_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
GOOGLE_CLINET_ID: ${{ secrets.GOOGLE_CLINET_ID }}
GOOGLE_CLINET_SECRET: ${{ secrets.GOOGLE_CLINET_SECRET }}
- name: Update-YoutubeMarkdownFiles
shell: pwsh
run: ./.powershell/build/Update-YoutubeMarkdownFiles.ps1
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# Step 6: Create or update the pull request
- name: Create or update Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.app-token.outputs.token }}
branch: "youtube-daily-update"
base: main
committer: NKDARobot[bot] <NKDARobot[bot]@noreply.nkdagility.com>
title: "Youtube Daily Pull"
body: "This pull request contains daily updates from the automated workflow."
reviewers: mrhinsh