sync-upstream #2
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: sync-upstream | |
| on: | |
| schedule: | |
| - cron: '17 3 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: sync-upstream | |
| cancel-in-progress: false | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.3.13' | |
| - name: Refresh upstream pin | |
| run: node ./scripts/sync-upstream.mjs --write | |
| - name: Stop early when nothing changed | |
| id: diff | |
| run: | | |
| if git diff --quiet -- upstream-gstack.json; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Run tests | |
| if: steps.diff.outputs.changed == 'true' | |
| run: bun test | |
| - name: Build release artifacts from bootstrapped upstream | |
| if: steps.diff.outputs.changed == 'true' | |
| env: | |
| GSTACK_CODEX_UPSTREAM_ROOT: ${{ github.workspace }}/dist/.sync-upstream/gstack | |
| run: | | |
| node ./scripts/build-release-artifacts.mjs | |
| npm pack --json --dry-run > /tmp/npm-pack.json | |
| - name: Create pull request | |
| if: steps.diff.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| branch: chore/sync-upstream-gstack | |
| commit-message: 'chore: sync upstream gstack' | |
| title: 'chore: sync upstream gstack' | |
| body: | | |
| Updates `upstream-gstack.json` to the latest upstream `garrytan/gstack` commit. | |
| This PR was generated by `sync-upstream.yml`. |