Sync Enum #218
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: Sync Enum | |
on: | |
workflow_dispatch: {} | |
schedule: | |
# https://crontab.guru/#0_9_*_*_1 | |
# At 09:00 on Monday. | |
- cron: '0 9 * * 1' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.ACTION_DEPLOY_KEY }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run sync | |
- name: git config | |
run: | | |
git config --local user.name "GitHub Actions" | |
git config --local user.email "[email protected]" | |
- name: git commit | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
BRANCH="chore/sync-$(date +%s)" | |
MESSAGE="Sync with latest Postgres Errors" | |
# UNCOMMENT FOR TESTING # | |
# echo "// test for ${BRANCH}" >> src/PostgresError.ts | |
git checkout -b ${BRANCH} | |
git add src/PostgresError.ts | |
if [[ `git status --porcelain` ]]; then | |
git commit --message "${MESSAGE}" | |
git push -u origin ${BRANCH} | |
gh pr create --title "${MESSAGE}" --body "" | |
fi |