Repository navigation
Experiment with PAT for Marking Auto-Merge #1
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: Experiment - PAT Auto-merge | ||
| # Throwaway experiment: does enabling auto-merge with GH_ACTIONS_REPO_TOKEN make the | ||
| # PR's merged_by a User, and does the resulting push trigger the merge-forward workflow? | ||
| # Delete this branch when done. | ||
| on: | ||
| push: | ||
| branches: [ 'experiment/pat-auto-merge' ] | ||
| permissions: | ||
| contents: read | ||
| env: | ||
| PR_NUMBER: 4050 | ||
| GH_REPO: ${{ github.repository }} | ||
| jobs: | ||
| enable-auto-merge: | ||
| name: Enable Auto-merge With PAT | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event.repository.fork == false }} | ||
| steps: | ||
| - name: Identify Token Owner | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} | ||
| run: gh api user --jq '"token owner: \(.login) (\(.type))"' | ||
| - name: Enable Auto-merge | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} | ||
| run: gh pr merge "$PR_NUMBER" --auto --rebase | ||
| - name: Show Pull Request State | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} | ||
| run: gh pr view "$PR_NUMBER" --json state,baseRefName,autoMergeRequest | ||