Skip to content

Commit

Permalink
fix: --check-word not using the word from --get-word on the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Sep 23, 2024
1 parent 4c7d5d2 commit 98ead1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

- name: Get a random word
id: get-word
run: python -Wd -m wikidict ${{ matrix.locale }} --get-word=''
run: python -Wd -m wikidict ${{ matrix.locale }} --get-word='' --raw

- name: Check that random word
run: python -Wd -m wikidict ${{ matrix.locale }} --check-word=${{ steps.get-word.outputs.word }}
run: python -Wd -m wikidict ${{ matrix.locale }} --check-word="${{ steps.get-word.outputs.word }}"
5 changes: 4 additions & 1 deletion wikidict/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def get_random_word(locale: str) -> str:
with requests.get(url) as req:
word = str(req.json()["query"]["random"][0]["title"])

log.debug("🎯 word = %r", word)
if "CI" in os.environ:
with open(os.environ["GITHUB_OUTPUT"], "ab") as fh:
fh.write(f"word={word}\n".encode())

return word


Expand Down

0 comments on commit 98ead1d

Please sign in to comment.