Syntax Enforcer #14
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: Syntax Enforcer | |
on: | |
schedule: | |
- cron: 0 0 1 * * | |
workflow_dispatch: | |
jobs: | |
qa: | |
name: Syntax Enforcer | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'PreMiD' | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js 16 | |
uses: actions/[email protected] | |
with: | |
node-version: 16 | |
cache: npm | |
- name: Install dependencies | |
run: HUSKY=0 npm ci | |
- name: Start SE | |
run: | | |
git config --global core.quotePath false | |
git config --global core.precomposeunicode true | |
npm run schemaEnforcer uncommitted | |
- name: Commit any changes | |
if: always() | |
run: | | |
git add .; | |
if git diff-index --quiet HEAD --; then | |
exit 0; | |
else | |
hub config --global hub.protocol https; | |
hub config --global user.email "${GITHUB_EMAIL}"; | |
hub config --global user.name "${GITHUB_USER}"; | |
hub remote set-url origin "https://${GITHUB_TOKEN}:[email protected]/${GITHUB_REPOSITORY}.git"; | |
git config --local user.email "${GITHUB_EMAIL}"; | |
git config --local user.name "${GITHUB_USER}"; | |
git checkout -b semid/qa/`date +%F-%H-%M`; | |
git commit -sam "refactor: run syntax enforcer"; | |
hub pull-request -b "PreMiD:main" -p -m "refactor: monthly SE" -m "*beep boop* I've prettified and refactored some Presences and sorted all metadata files..." -l chore; | |
fi | |
env: | |
GITHUB_USER: SeMiD | |
GITHUB_EMAIL: [email protected] | |
GITHUB_TOKEN: ${{ secrets.AUTOMERGE }} |