Updating hash files #6369
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
# Script to regenerate the TypeScript on the main branch, if it ever happens | |
# that the JS bundle we find there is out of sync. | |
name: Automatically update JavaScript bundle | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
update_javascript: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout branch (with token) | |
if: github.event_name == 'push' | |
with: | |
fetch-depth: 1 | |
# We need to pass the token here -- the commit action below will not overwrite the token to push. | |
token: ${{ secrets.FELIENNE_GITHUB_ACCESS_TOKEN }} | |
- uses: actions/checkout@v3 | |
name: Checkout branch (on pull requests) | |
if: github.event_name != 'push' | |
with: | |
fetch-depth: 1 | |
- name: Install Nodejs dependencies | |
run: | | |
npm ci | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install Python dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install -r requirements.txt | |
# This is necessary for the TypeScript to contain translations | |
# from Gettex. | |
- name: Compiling Babel translations | |
run: | | |
pybabel compile -f -d translations | |
- name: Compile TypeScript to JavaScript | |
run: build-tools/heroku/generate-grammars-and-js | |
- name: Commit changed files | |
uses: stefanzweifel/[email protected] | |
if: github.event_name == 'push' | |
with: | |
commit_message: Automatically update JavaScript bundle 🤖 beep boop | |
branch: ${{ github.ref_name }} | |
env: | |
# This is necessary to bypass branch protection (which will disallow non-reviewed pushes otherwise) | |
GITHUB_TOKEN: ${{ secrets.FELIENNE_GITHUB_ACCESS_TOKEN }} |