generated from ryohidaka/composite-action-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
82 lines (65 loc) · 2.17 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: "annict2anilist"
author: "ryohidaka"
description: "Annict から AniList にライブラリを同期する `annict2anilist` を実行するGitHub Actions."
branding:
color: orange
icon: tv
inputs:
annict-client-id:
description: "AnnictのクライアントID"
required: true
annict-client-secret:
description: "Annictのクライアントシークレット"
required: true
anilist-client-id:
description: "AnilistのクライアントID"
required: true
anilist-client-secret:
description: "Anilistのクライアントシークレット"
required: true
anilist-access-token:
description: "Anilistのアクセストークン"
required: true
anilist-refresh-token:
description: "Anilistのリフレッシュトークン"
required: true
annict-access-token:
description: "Annictのリフレッシュトークン"
required: true
dry-run:
description: "デバッグフラグ (デフォルト: `0`)"
required: false
default: 0
runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set GitHub Path
run: echo "GITHUB_ACTION_PATH=${GITHUB_ACTION_PATH}" >> $GITHUB_ENV
shell: bash
- name: Generate token directory
run: mkdir -p $GITHUB_ACTION_PATH/token
shell: bash
- name: Generate token-anilist.json
run: |
$GITHUB_ACTION_PATH/scripts/anilist_token.sh \
${{ inputs.anilist-access-token }} \
${{ inputs.anilist-refresh-token }}
shell: bash
- name: Generate token-annict.json
run: |
$GITHUB_ACTION_PATH/scripts/annict_token.sh \
${{ inputs.annict-access-token }}
shell: bash
- name: Run annict2anilist container
run: |
chmod -R 777 $GITHUB_ACTION_PATH/token
docker compose -f $GITHUB_ACTION_PATH/docker-compose.yml up
shell: bash
env:
ANNICT_CLIENT_ID: ${{ inputs.annict-client-id }}
ANNICT_CLIENT_SECRET: ${{ inputs.annict-client-secret }}
ANILIST_CLIENT_ID: ${{ inputs.anilist-client-id }}
ANILIST_CLIENT_SECRET: ${{ inputs.anilist-client-secret }}
DRY_RUN: ${{ inputs.dry-run }}