konjacbot #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: konjacbot | |
on: | |
schedule: | |
- cron: '0 1 * * 1-5' # 平日朝10時(JST)に実行 (JSTはUTC+9なので、UTCでは1時) | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
translate: | |
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'package.json' | |
- run: npm ci | |
- run: npm run kj:diff | |
- run: npm run kj:cp | |
- run: npm run kj:mod | |
- run: npm run kj:ja | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
- run: npm run kj:img | |
- run: npm run prettier:fix #TODO txtlintの設定がfixしたらworkflowに追加する | |
- run: npm run kj:pr | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
BASE_BRANCH_NAME: ${{ github.ref_name }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |