Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create issue to enable branch auto-deletion
- name: Create issue to enable repository merge settings
run: |
owner_repo="${{ github.repository }}"
issue_title="Enable 'Automatically delete head branches' setting"
issue_body="Please go to [repository settings](https://github.com/${owner_repo}/settings#merge-button-settings) and enable **Automatically delete head branches**."
issue_title="Enable repository merge settings"
issue_body="Please go to [repository settings](https://github.com/${owner_repo}/settings#merge-button-settings) and configure the following:\n\n- [ ] Automatically delete head branches\n- [ ] Allow auto-merge"

curl -s -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-d "{\"title\":\"${issue_title}\",\"body\":\"${issue_body}\"}" \
-d "$(jq -n \
--arg title "$issue_title" \
--arg body "$issue_body" \
'{title: $title, body: $body}')" \
"https://api.github.com/repos/${owner_repo}/issues"

- name: Create / update default issue labels
Expand Down
Loading