diff --git a/.github/workflows/this_week_in_rust.yml b/.github/workflows/this_week_in_rust.yml index eaff104..e891c68 100644 --- a/.github/workflows/this_week_in_rust.yml +++ b/.github/workflows/this_week_in_rust.yml @@ -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: @@ -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); diff --git a/gen_translated.py b/gen_translated.py index b35b3bf..0e5abf1 100644 --- a/gen_translated.py +++ b/gen_translated.py @@ -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)