Skip to content

translate-articles

translate-articles #57

name: translate-articles
on:
schedule:
- cron: '0 13 * * 6'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Deno environment
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Translate latest articles
id: translate-latest-articles
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL_ID: ${{ vars.MAIN_SLACK_CHANNEL_ID }}
run: |
cd ${GITHUB_WORKSPACE}/scripts
deno task translate:en
cat translated.json
{
echo 'translated<<EOF'
cat translated.json
echo ''
echo EOF
} >> $GITHUB_OUTPUT
- name: Commit and Create Pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "feat: Add English-translated articles"
author: "mameka <[email protected]>"
branch: auto-translation
delete-branch: true
title: "[no-image] Add English-translated articles"
body: >
Check auto English-translated articles.
The following articles have been translated.
```json
${{ steps.translate-latest-articles.outputs.translated }}
```
reviewers: kudoh
labels: bot