|  | 
|  | 1 | +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | 
|  | 2 | + | 
|  | 3 | +name: "Pull request title edited" | 
|  | 4 | + | 
|  | 5 | +on: | 
|  | 6 | + pull_request_target: | 
|  | 7 | + types: | 
|  | 8 | + - edited | 
|  | 9 | + | 
|  | 10 | +concurrency: | 
|  | 11 | + group: pr-title-edited-${{ github.head_ref }} # will be canceled on subsequent pushes in pull requests | 
|  | 12 | + cancel-in-progress: true | 
|  | 13 | + | 
|  | 14 | +jobs: | 
|  | 15 | + revert-title: | 
|  | 16 | + name: "Revert title" | 
|  | 17 | + runs-on: 'ubuntu-latest' | 
|  | 18 | + | 
|  | 19 | + steps: | 
|  | 20 | + - run: echo "${{ toJSON(github.event.changes) }}" | 
|  | 21 | + - uses: octokit/request-action@v2.x | 
|  | 22 | + if: github.event.sender.login != 'phpstan-bot' && github.event.changes.title.from != '' | 
|  | 23 | + with: | 
|  | 24 | + route: PATCH /repos/{owner}/{repo}/pulls/{pull_number} | 
|  | 25 | + owner: phpstan | 
|  | 26 | + repo: phpstan-src | 
|  | 27 | + pull_number: ${{ github.event.number }} | 
|  | 28 | + title: ${{ github.event.changes.title.from }} | 
|  | 29 | + env: | 
|  | 30 | + GITHUB_TOKEN: ${{ secrets.PHPSTAN_BOT_TOKEN }} | 
0 commit comments