Add new Item details format code generator #23
Workflow file for this run
This file contains 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: Auto-merge pull requests | |
on: | |
pull_request: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
auto-merge: | |
name: Enable auto-merge | |
runs-on: ubuntu-latest | |
if: > | |
contains(fromJSON('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.event.pull_request.user.login) | |
&& github.event.pull_request.head.repo.full_name == github.repository | |
&& github.event.pull_request.commits == 1 | |
steps: | |
- name: Check changed files | |
if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const response = await github.rest.pulls.listFiles({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
}); | |
const changedFiles = response.data.map(file => file.filename); | |
if (changedFiles.length !== 1 || changedFiles[0] !== '.pre-commit-config.yaml') { | |
core.setFailed( | |
`Unexpected files modified:\n${changedFiles.join('\n')}` | |
); | |
} | |
- name: Enable auto-merge | |
run: gh pr merge --auto --merge "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} |