1+ name : prepare-embargoed-branches
2+ run-name : Prepare branches for embargoed ${{ inputs.mingit-only && 'Min' || '' }}Git ${{ inputs.version }}
3+
4+ on :
5+ workflow_dispatch :
6+ inputs :
7+ version :
8+ description : ' The Git version for which to prepare the branches'
9+ required : true
10+ mingit-only :
11+ description : ' Only prepare the MinGit branches'
12+ default : false
13+ type : boolean
14+
15+ jobs :
16+ prepare-embargoed-branches :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : sanity check
20+ if : ${{ github.repository_owner == 'git-for-windows' }}
21+ run : echo "This action is not meant to be run on the Git for Windows repository" >&2 && exit 1
22+ - uses : actions/checkout@v4
23+ - name : identify actor
24+ id : actor
25+ uses : actions/github-script@v7
26+ with :
27+ script : |
28+ const githubApiRequest = require('./github-api-request')
29+ const answer = await githubApiRequest(
30+ console,
31+ '${{ secrets.GITHUB_TOKEN }}',
32+ 'GET',
33+ '/users/${{ github.triggering_actor }}'
34+ )
35+ core.setOutput('name', answer.name)
36+ core.setOutput('email', answer.email || '${{ github.triggering_actor }}@users.noreply.github.com')
37+ - name : configure
38+ run : |
39+ USER_NAME="${{ steps.actor.outputs.name }}" &&
40+ USER_EMAIL="${{ steps.actor.outputs.email }}" &&
41+ git config --global user.name "$USER_NAME" &&
42+ git config --global user.email "$USER_EMAIL" &&
43+ git config --global url.https://github.com/${{ github.repository_owner }}.insteadOf \
44+ https://github.com/embargoed-git-for-windows-builds &&
45+ git config --global credential.helper '' &&
46+ git config --global --add credential.helper cache
47+ - name : configure push token
48+ uses : actions/github-script@v7
49+ with :
50+ script : |
51+ const { callGit, getPushAuthorizationHeader } = require('./repository-updates.js')
52+ for (const repo of ['build-extra', 'git', 'git-sdk-32', 'git-sdk-64', 'git-sdk-arm64', 'MINGW-packages']) {
53+ const header = await getPushAuthorizationHeader(
54+ console,
55+ core.setSecret,
56+ ${{ secrets.GH_APP_ID }},
57+ ${{ toJSON(secrets.GH_APP_PRIVATE_KEY) }},
58+ context.repo.owner,
59+ repo
60+ )
61+ console.log(callGit(['config', '--global', `http.https://github.com/${context.repo.owner}/${repo}.extraHeader`, header]))
62+ }
63+ - name : Prepare embargoed branches
64+ run : sh -x ./prepare-embargoed-branches.sh ${{ inputs.mingit-only && '--mingit ' || ''}}"${{ inputs.version }}"
0 commit comments