Build Cron #1159
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: Build Cron | |
on: | |
schedule: | |
- cron: '* * 1 * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.MOL_TOKEN }} | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Setup | |
run: yarn --immutable | |
- name: Build | |
run: yarn build | |
- name: Test | |
run: yarn test | |
env: | |
JWT_EMAIL: ${{ secrets.JWT_EMAIL }} | |
JWT_KEY: ${{ secrets.JWT_KEY }} | |
NETWORK_CODE: ${{ secrets.NETWORK_CODE }} | |
- name: Update state | |
id: state | |
run: | # shell | |
COMMIT="$(yarn commit:state)" | |
COMMIT="${COMMIT//'%'/'%25'}" | |
COMMIT="${COMMIT//$'\n'/'%0A'}" | |
COMMIT="${COMMIT//$'\r'/'%0D'}" | |
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
if: steps.state.outputs.commit != '' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
body: ${{ fromJson(steps.state.outputs.commit).prBody }} | |
branch: ${{ fromJson(steps.state.outputs.commit).branch }} | |
commit-message: ${{ fromJson(steps.state.outputs.commit).commitMessage }} | |
labels: ${{ fromJson(steps.state.outputs.commit).labels }} | |
title: ${{ fromJson(steps.state.outputs.commit).prTitle }} |