cron.yml

 1---
 2name: cron
 3
 4on:
 5  schedule:
 6    - cron: '0 10 31 5 *' # 05/31 at 10:00
 7
 8permissions:
 9  contents: read
10
11jobs:
12  rename-default-branch:
13    runs-on: ubuntu-latest
14    if: github.ref_name == "master"
15    steps:
16      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17        with:
18          fetch-depth: 0
19
20      - name: configure git remote
21        run: |
22          git remote set-url origin git@github.com:git-bug/git-bug.git
23
24      - name: "merge pull request: 1464"
25        env:
26          GH_TOKEN: ${{ secrets.RENAME_TOKEN_1404 }}
27        run: gh pr merge 1464 --admin --squash
28
29      - name: "set default branch: refs/heads/trunk"
30        env:
31          GH_TOKEN: ${{ secrets.RENAME_TOKEN_1404 }}
32        run: gh repo edit --default-branch trunk
33
34      - name: "set base for all PRs: refs/heads/trunk"
35        env:
36          GH_TOKEN: ${{ secrets.RENAME_TOKEN_1404 }}
37        run: |-
38          for pr in $(gh pr list -B master -s open --json number --jq '.[] | .number'); do
39            gh pr edit "$pr" -B trunk
40          done