feat: expose a public failure and retry contract for browser-action errors #177
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: Sync rustwright changes to rustwright-cloud | |
| on: | |
| pull_request_target: | |
| types: [closed] | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| sync: | |
| if: >- | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.pull_request.merged == true && | |
| !contains(join(github.event.pull_request.labels.*.name, ','), 'sync') && | |
| !startsWith(github.event.pull_request.head.ref, 'repo-sync/')) | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Sync shared files to rustwright-cloud | |
| id: file-sync | |
| uses: Skyvern-AI/repo-file-sync-action@590c4ddbe1d7b5c4ca1e4b4edc85c7f919b6c26a # main | |
| with: | |
| GH_PAT: ${{ secrets.RUSTWRIGHT_SYNC_GH_PAT }} | |
| GIT_EMAIL: ${{ github.event.pull_request.user.id && format('{0}+{1}@users.noreply.github.com', github.event.pull_request.user.id, github.event.pull_request.user.login) || format('{0}@users.noreply.github.com', github.actor) }} | |
| GIT_USERNAME: ${{ github.event.pull_request.user.login || github.actor }} | |
| PR_LABELS: sync | |
| BRANCH_NAME: repo-sync/rustwright-${{ github.event.pull_request.number || github.run_id }} | |
| PR_BODY: ${{ github.event.pull_request.html_url || 'Manual sync from rustwright' }} | |
| # The sync PR title (and its squash commit on the target main) should | |
| # carry the originating change's title; dispatch runs have no PR context. | |
| PR_TITLE: ${{ github.event.pull_request.title || format('Sync rustwright changes to rustwright-cloud (run {0})', github.run_id) }} | |
| - name: Link the rustwright-cloud PR | |
| if: github.event_name == 'pull_request_target' && steps.file-sync.outputs.pull_request_urls | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| PR_URLS: ${{ steps.file-sync.outputs.pull_request_urls }} | |
| with: | |
| script: | | |
| let urls; | |
| try { | |
| urls = JSON.parse(process.env.PR_URLS); | |
| } catch { | |
| urls = [process.env.PR_URLS].filter(Boolean); | |
| } | |
| if (urls.length) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| body: urls.map((url) => `Synced to rustwright-cloud: ${url}`).join('\n'), | |
| }); | |
| } |