Repository navigation
feat(location): sync a location only after runs end or on request #745
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: Request Auto-Merge | ||
|
Check warning on line 1 in sqlstack-io/.github/.github/workflows/auto-merge.yml
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| # Repositories with a merge queue require this workflow on the queue's merge groups too. There is | ||
| # nothing to request there; the merge-group job only lets the run conclude as a success. | ||
| merge_group: | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| jobs: | ||
| merge-group: | ||
| if: github.event_name == 'merge_group' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Nothing to request for a merge group | ||
| run: echo "The merge queue's required checks decide this merge." | ||
| request-auto-merge: | ||
| if: >- | ||
| github.event_name == 'pull_request_target' && | ||
| !github.event.pull_request.draft && | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Create delivery token | ||
| id: delivery-token | ||
| uses: actions/create-github-app-token@v2 | ||
| with: | ||
| app-id: ${{ vars.CHIO_DELIVERY_APP_ID }} | ||
| private-key: ${{ secrets.CHIO_DELIVERY_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| repositories: ${{ github.event.repository.name }} | ||
| - name: Request squash auto-merge | ||
| env: | ||
| GH_TOKEN: ${{ steps.delivery-token.outputs.token }} | ||
| PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| run: >- | ||
| gh pr merge "$PR_URL" | ||
| --repo "$GITHUB_REPOSITORY" | ||
| --auto | ||
| --squash | ||
| --delete-branch | ||
| --match-head-commit "$PR_HEAD_SHA" | ||