Update UnicodeData.txt monthly #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update UnicodeData.txt monthly | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Updating latest unicode version in precis-profiles | |
run: | | |
file=precis-profiles/build.rs | |
new_version=`curl -Ls -o /dev/null -w %{url_effective} https://www.unicode.org/versions/latest/ | grep -o 'Unicode[0-9]\+\.[0-9]\+\.[0-9]\+' | sed 's/Unicode//'` | |
awk -v new_version="$new_version" '/const UNICODE_VERSION: &str = "[0-9]+\.[0-9]+\.[0-9]+";/ && !done {sub(/"[0-9]+\.[0-9]+\.[0-9]+"/, "\""new_version"\""); done=1} 1' "$file" > "$file.tmp" && mv "$file.tmp" "$file" | |
base_url="https://www.unicode.org/Public/$new_version" | |
curl -s -o precis-profiles/resources/ucd/UnicodeData.txt "$base_url/ucd/UnicodeData.txt" | |
echo "UNICODE_VERSION=$new_version" >> $GITHUB_ENV | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Update precis-profiles to the latest unicode version (${{ env.UNICODE_VERSION }}) | |
title: Update precis-profiles to the latest unicode version (${{ env.UNICODE_VERSION }}) | |
body: | | |
Update precis-profiles to the latest version of Unicode (${{ env.UNICODE_VERSION }}). | |
This commit updates the next files: | |
* Updates build.rs to use the latest Unicode version (${{ env.UNICODE_VERSION }}) | |
* Updates the [UnicodeData.txt][1] resource file | |
[1]: https://www.unicode.org/Public/${{env.UNICODE_VERSION}}/ucd/UnicodeData.txt | |
branch: bump-unicode-data | |
base: main | |
labels: data | |
assignees: ${{ github.actor }} | |
reviewers: ${{ github.actor }} | |
delete-branch: true |