chore(CI): check for updated builtins #6
Workflow file for this run
This file contains hidden or 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: UPDATE_BUILTINS | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '17 2 * * 0' # Every Sunday at 2:17 AM (random time to distribute load) | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| node-version: [ 20 ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Setup project | |
| uses: bpmn-io/actions/setup@latest | |
| - name: Checkout camunda-docs | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: camunda/camunda-docs | |
| path: camunda-docs | |
| - name: Update builtins | |
| run: npm run compile-builtins | |
| - name: All | |
| run: npm run all | |
| - name: Check if files changed | |
| id: check_builtins | |
| run: | | |
| files=$(git status -u --porcelain) | |
| if [ -n "$files" ]; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Debug | |
| run: | | |
| echo changed: ${{ steps.check_builtins.outputs.changed }} | |
| echo eventname: ${{ github.event_name }} | |
| echo eventtype: ${{ github.event.action }} | |
| echo prtype: ${{ github.event.action }} | |
| echo base: ${{ github.event.pull_request.base.ref }} | |
| - name: Add comment on PRs | |
| if: steps.check_builtins.outputs.changed == 'true' && github.event_name == 'pull_request' && github.event.action == 'opened' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| NUMBER: ${{ github.event.number }} | |
| BODY: | | |
| This PR would lead to changes in the repo. Consider if you want to include all changes in this PR or if there's already a PR that includes these changes. | |
| run: gh issue comment "$NUMBER" --body "$BODY" | |
| - name: Create PRs automatically | |
| if: steps.check_builtins.outputs.changed == 'true' && (github.event_name == 'scheduled' || github.event_name == 'workflow_dispatch') | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| commit-message: 'chore: update builtins' | |
| branch: update-builtins | |
| title: 'Update builtins' | |
| body: | | |
| :robot: Automated PR to update builtin functions |