Skip to content

Commit

Permalink
ci: fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Oct 24, 2023
1 parent 9798984 commit d0c2ee0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/this_week_in_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
run: |
wget "https://raw.githubusercontent.com/rust-lang/this-week-in-rust/master/content/$DATE-this-week-in-rust.md" -O "$DATE-tmp.md"
- name: Remove Unnecesary Lines
run: tail -n +6 "$DATE-tmp.md" > "$DATE-tmp.md"
run: tail -n +6 "$DATE-tmp.md">$DATE.md
- name: Add emoji
run: sed -i -e 's/## Updates from Rust Community/## Updates from Rust Community 🥰/g' "$DATE-tmp.md"
run: sed -i -e 's/## Updates from Rust Community/## Updates from Rust Community 🥰/g' "$DATE.md"
# Translate process
- uses: actions/setup-python@v4
with:
Expand All @@ -48,7 +48,7 @@ jobs:
REGION: ${{ github.event.inputs.MS_TRANSLATE_REGION }}
run: |
pip install uuid requests
python3 gen_translated.py ${{ env.DATE }}-tmp.md
python3 gen_translated.py ${{ env.DATE }}.md
- name: Create Translated File
run: |
week=$(ls esta_semana_en_rust | wc -l);
Expand Down
4 changes: 4 additions & 0 deletions gen_translated.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@
raw_file.close()

print(json.dumps(response, sort_keys=True, indent=4, separators=(',', ': ')))

# generate ouput
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f'text={response[0].translations[0].text}', file = fh)

0 comments on commit d0c2ee0

Please sign in to comment.