Skip to content

Build types every Friday evening #112

Build types every Friday evening

Build types every Friday evening #112

Workflow file for this run

name: Build types every Friday evening
on:
workflow_dispatch:
schedule:
- cron: "42 21 * * 5"
env:
PNPM_VERSION: "8.15.0"
jobs:
update_types:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.11.0
- name: Build geoview-core to update types
run: |
npm install -g @microsoft/rush
rush update
rush build:core
- name: Create new branch with just types and package.json
run: |
exists=$(git ls-remote --heads origin new-types | wc -l)
if [ ${exists} != 0 ];
then
echo "Delete branch new-types (and close associated PR, if necessary) and run the action again."
exit 1
fi
git checkout types
git checkout -b new-types
rm -r src
cp -r ./packages/geoview-core/types/* ./
rm -r common
rm -r packages
git config --global user.name $USER
git add .
git status
CHANGES=$(git status -s | wc -l)
if [ $CHANGES == 0 ];
then
echo "No changes made."
exit 1
fi
git commit -m "types updated"
git push -u origin HEAD:new-types
- name: Open pull request to types branch
uses: repo-sync/pull-request@v2
with:
source_branch: "new-types"
destination_branch: "types"
pr_title: "Update to types"
pr_body: |
*An automated PR* - please delete branch after merge