-
-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (52 loc) · 2.12 KB
/
transcript.yml
File metadata and controls
56 lines (52 loc) · 2.12 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
name: Convert subtitle to transcript
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
target-video:
description: Video ID of the target video
required: true
target-language:
description: The language to be converted
required: true
default: en
type: choice
options:
- en
- zh_tw
- ja
# Allow pull request
permissions:
pull-requests: write
repository-projects: write
contents: write
jobs:
conversion:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v3.1.3
- name: Checkout
uses: actions/checkout@v3
# Converts specified subtitle to transcript
- name: Convert subtitle to transcript
run: python ./tools/subtitle_to_transcript.py ${{ github.event.inputs.target-video }} ${{ github.event.inputs.target-language }}
- name: Add transcript to be tracked (en)
if: github.event.inputs.target-language =='en'
run: |
git add static/src/transcript/${{ github.event.inputs.target-video }}.txt
- name: Add transcript to be tracked (other languages)
if: github.event.inputs.target-language !='en'
run: |
git add static/src/translation/${{ github.event.inputs.target-language }}/transcript/${{ github.event.inputs.target-video }}.txt
- name: Create Pull Request
if: ${{ success() }}
uses: peter-evans/create-pull-request@v4
with:
commit-message: "Generated transcript for ${{ github.event.inputs.target-video }}.${{ github.event.inputs.target-language }}"
title: "Generated transcript for ${{ github.event.inputs.target-video }}.${{ github.event.inputs.target-language }}"
body: "Generated transcript for ${{ github.event.inputs.target-video }}.${{ github.event.inputs.target-language }}"
base: main
labels: automated-pr
branch: transcript-generation-${{ github.event.inputs.target-video }}-${{ github.event.inputs.target-language }}
delete-branch: true