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
38 changes: 38 additions & 0 deletions .github/workflows/git-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,47 @@ jobs:
cp /usr/src/build-extra/mingit/root/etc/package-versions.txt artifacts/
- name: Publish ${{matrix.artifact.name}}-${{env.ARCHITECTURE}}
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: ${{matrix.artifact.name}}-${{env.ARCHITECTURE}}
path: artifacts
- uses: actions/create-github-app-token@v1
if: matrix.artifact.name == 'installer' && github.event.inputs.architecture == 'x86_64'
id: pr-comment-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ${{ env.OWNER }}
repositories: ${{ env.REPO }}
- name: Add a PR comment suggesting to validate the installer manually
if: matrix.artifact.name == 'installer' && github.event.inputs.architecture == 'x86_64'
uses: actions/github-script@v7
with:
github-token: ${{ steps.pr-comment-token.outputs.token }}
script: |
const installerURL = ${{ toJSON(steps.upload-artifact.outputs.artifact-url) }}
const preFlightChecklistURL = 'https://github.com/git-for-windows/build-extra/blob/HEAD/installer/checklist.txt'
const body = `## Validate the installer manually

The [installer](${installerURL}) was built successfully;
Please download, install, and run through [the pre-flight check-list](${preFlightChecklistURL}).`

const fs = require('fs')
const gitSHA = fs.readFileSync('bundle-artifacts/git-commit-oid')
const q = `repo:${process.env.OWNER}/${process.env.REPO}+is:pr+is:open+${gitSHA}`
const { data } = await github.rest.search.issuesAndPullRequests({ q })
if (data.items.length !== 1) {
core.warning(`${data.items.length} PRs found for ${gitSHA}, not posting a comment, would have posted:\n${body}`)
} else {
const req = {
owner: process.env.OWNER,
repo: process.env.REPO,
issue_number: data.items[0].number,
body: `${body}\n@${data.items[0].user.login} ☝️`,
}

await github.rest.issues.createComment(req)
}
- name: restore check-run state
if: needs.pkg.outputs.check-run-state != '' && always()
id: check-run-state
Expand Down