From 65ebf180e9488784e22556d87a0640102db2dedc Mon Sep 17 00:00:00 2001 From: hyeonggil <> Date: Fri, 27 Mar 2026 22:59:25 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20ci:=20Chrome=20=EB=B0=94?= =?UTF-8?q?=EC=9D=B4=EB=84=88=EB=A6=AC=20=EA=B2=BD=EB=A1=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=ED=99=95=EC=9D=B8=20=EB=8B=A8=EA=B3=84?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CI 환경에서 Chrome 바이너리 경로를 환경 변수로 설정하도록 수정 - Chrome 버전 확인 명령어를 setup-chrome의 출력값을 사용하도록 변경 --- .github/workflows/lotto-buy.yml | 4 +++- lotto-runner/lotto_auto_buy.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lotto-buy.yml b/.github/workflows/lotto-buy.yml index c00a561..fa9a967 100644 --- a/.github/workflows/lotto-buy.yml +++ b/.github/workflows/lotto-buy.yml @@ -74,6 +74,7 @@ jobs: .venv/bin/pip install -r lotto-runner/requirements.txt - name: Chrome 설치 + id: setup-chrome uses: browser-actions/setup-chrome@v1 with: install-dependencies: true @@ -81,7 +82,7 @@ jobs: - name: Chrome 확인 run: | - chrome --version || google-chrome --version || chromium --version + "${{ steps.setup-chrome.outputs.chrome-path }}" --version - name: 로또 구매 실행 env: @@ -89,4 +90,5 @@ jobs: LOTTO_USER_PW: ${{ secrets.LOTTO_USER_PW }} TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + CHROME_BIN: ${{ steps.setup-chrome.outputs.chrome-path }} run: .venv/bin/python3 lotto-runner/lotto_auto_buy.py diff --git a/lotto-runner/lotto_auto_buy.py b/lotto-runner/lotto_auto_buy.py index 8bd93c1..b35c382 100644 --- a/lotto-runner/lotto_auto_buy.py +++ b/lotto-runner/lotto_auto_buy.py @@ -59,6 +59,10 @@ logger = logging.getLogger(__name__) def create_driver(): """Chrome WebDriver 생성""" options = Options() + # CI 환경에서 setup-chrome이 설치한 Chrome 바이너리 경로 지정 + chrome_bin = os.environ.get("CHROME_BIN", "") + if chrome_bin: + options.binary_location = chrome_bin if CONFIG["HEADLESS"]: options.add_argument("--headless=new") options.add_argument("--no-sandbox")