File "set-subsplit-default-branch.yml"
Full path: /home/orbitecv/orbite-school.orbit.et/vendor/league/flysystem/.github/workflows/set-subsplit-default-branch.yml
File size: 932 B
MIME-type: text/plain
Charset: utf-8
Download Open Edit Advanced Edit Back
---
name: Update default sub-split branch
on: workflow_dispatch
jobs:
set-default-branch:
name: Set default git branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
persist-credentials: 'false'
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const fs = require('fs');
let splits = JSON.parse(fs.readFileSync('config.subsplit-publish.json'))['sub-splits'];
for (let split of splits) {
const { groups: { repo } } = /git@github\.com:thephpleague\/(?<repo>.*)\.git/.exec(split.target);
console.log(`Found repo ${repo}`);
await github.rest.repos.update({
owner: 'thephpleague',
repo,
default_branch: '3.x',
});
}