CreatePrivateFork #22
This file contains hidden or 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: CreatePrivateFork | |
| run-name: "CreatePrivateFork" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| src_repo: | |
| description: 'Source repo in asterisk org:' | |
| required: true | |
| type: string | |
| dst_repo: | |
| description: 'Destination repo in asterisk org:' | |
| required: true | |
| type: string | |
| actions_ref: | |
| description: 'JSON object reference to the actions. Default: { "owner": "asterisk", "repo": "asterisk-ci-actions", "branch": "main" }' | |
| type: string | |
| required: false | |
| default: '{ "owner": "asterisk", "repo": "asterisk-ci-actions", "branch": "main" }' | |
| env: | |
| ACTIONS_OWNER: ${{ fromJSON(inputs.actions_ref).owner }} | |
| ACTIONS_REPO: ${{ fromJSON(inputs.actions_ref).repo }} | |
| ACTIONS_BRANCH: ${{ fromJSON(inputs.actions_ref).branch }} | |
| SCRIPT_DIR: ${{ github.workspace }}/asterisk-ci-actions/scripts | |
| GITHUB_TOKEN: ${{ secrets.ASTERISKTEAM_PAT }} | |
| SRC_REPO: ${{ inputs.src_repo }} | |
| DST_REPO: ${{ inputs.dst_repo }} | |
| jobs: | |
| CreatePrivateFork: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup | |
| run: | | |
| # Setup | |
| wget -qO asterisk-ci-actions.tar.gz \ | |
| https://github.com/${ACTIONS_OWNER}/${ACTIONS_REPO}/archive/refs/heads/${ACTIONS_BRANCH}.tar.gz | |
| tar -xf asterisk-ci-actions.tar.gz --transform="s/^${ACTIONS_REPO}-${ACTIONS_BRANCH}/asterisk-ci-actions/g" | |
| - name: CreateFork | |
| run: | | |
| fix_branches=$(gh -R asterisk/${SRC_REPO} variable get SECURITY_FIX_BRANCHES | sed -n -r -e 's/("|\[|\])//gp') | |
| ${SCRIPT_DIR}/createPrivateFork.sh \ | |
| --src-repo=${SRC_REPO} \ | |
| --dst-repo=${DST_REPO} \ | |
| --security-fix-branches=${fix_branches} | |
| - name: CopyVars | |
| uses: ./asterisk-ci-actions/CopyRepoVariables | |
| with: | |
| src_repo: ${{ inputs.src_repo }} | |
| dst_repo: ${{ inputs.dst_repo }} | |
| github_token: ${{ secrets.ASTERISKTEAM_PAT }} | |
| UpdateControlData: | |
| needs: CreatePrivateFork | |
| uses: ./.github/workflows/UpdateControlData.yml | |
| with: | |
| repo: ${{ inputs.dst_repo }} | |
| secrets: inherit | |