✨ feat(workflows): require GITHUB_TOKEN secret for auto-merge and CI … #1
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
| # Auto Merge PRs for stage/main after CI passes | ||
| # Maintainers: This workflow automates PR merges to 'stage' and 'main' after tests pass. | ||
| # Uses pascalgn/automerge-action for robust, label-free automerge. | ||
| name: Auto Merge PRs | ||
| # Triggered by workflow call | ||
| on: | ||
| workflow_call: | ||
| # Define inputs and secrets here if needed for reuse | ||
| secrets: | ||
| GITHUB_TOKEN: | ||
| required: true | ||
| permissions: | ||
| pull-requests: write | ||
| contents: write | ||
| checks: read | ||
| concurrency: | ||
| group: auto-merge-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| automerge: | ||
| if: github.event.pull_request.base.ref == 'stage' || github.event.pull_request.base.ref == 'main' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: variablesoftware/github-actions-setup-and-test@main | ||
| # - uses: ./.github/actions/setup-and-test | ||
| - name: Automerge PR if CI passes | ||
| uses: pascalgn/automerge-action@v0.16.4 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| MERGE_METHOD: squash | ||
| MERGE_LABELS: '' | ||
| MERGE_FORKS: 'true' | ||
| MERGE_RETRIES: '10' | ||
| MERGE_RETRY_SLEEP: '60000' | ||
| UPDATE_LABELS: '' | ||
| UPDATE_METHOD: 'rebase' | ||
| LOG: 'DEBUG' | ||