Bmyc bumps #51
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: Bmyc bumps | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 2 * * 1' | |
env: | |
NPM_CACHE_NAME: 'npm-cache' | |
NPM_CACHE_PATH: '~/.npm' | |
jobs: | |
Bmyc: | |
name: Bump thirdparties using Bmyc | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Bump thirdparties and create PR | |
env: | |
LOG_FILE: 'workflow.log' | |
PR_TITLE: 'build: bump bmyc assets' | |
BRANCH_NAME: 'build/bump_bmyc_assets' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BMYC_GITHUB_TOKEN: ${{ secrets.BMYC_GITHUB_TOKEN }} | |
run: | | |
printf "%70s\n" | tr ' ' '-' | |
npm ci | |
npx bmyc --version | |
printf "%70s\n" | tr ' ' '-' | |
npx bmyc --summary-pr ${LOG_FILE} | |
if [[ $(git status --porcelain | wc -l) -gt 0 && -f ${LOG_FILE} ]];then | |
git checkout -b ${BRANCH_NAME} | |
git add -u . | |
git config --local user.name "GitHub Action" | |
git config --local user.email "[email protected]" | |
git commit -m "${PR_TITLE}" | |
git push -f origin ${BRANCH_NAME} | |
hub pull-request -f --file ${LOG_FILE} -l "internal" --base main --head ${BRANCH_NAME} | |
fi |