Skip to content

Commit

Permalink
Merge pull request #123 from git-for-windows/retire-the-azure-pipelin…
Browse files Browse the repository at this point in the history
…e-trigger

Retire the Azure Pipeline trigger
  • Loading branch information
dscho authored Feb 13, 2025
2 parents 92e1d90 + 496cfb1 commit adc1a0e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 192 deletions.
187 changes: 0 additions & 187 deletions GitForWindowsHelper/azure-pipelines.js

This file was deleted.

3 changes: 3 additions & 0 deletions GitForWindowsHelper/trigger-workflow-dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const waitForWorkflowRun = async (context, owner, repo, workflow_id, after, toke
}

const triggerWorkflowDispatch = async (context, token, owner, repo, workflow_id, ref, inputs) => {
if ('true' === process.env.DO_NOT_TRIGGER_ANYTHING) {
throw new Error(`Would have triggered workflow ${workflow_id} on ${owner}/${repo} with ref ${ref} and inputs ${JSON.stringify(inputs)}`)
}
const { headers: { date } } = await githubApiRequest(
context,
token,
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ For convenience, the command can be abbreviated as `/add relnote <type> <message

**Where can it be called?** In `git-for-windows/git`'s [Pull Requests](https://github.com/git-for-windows/git/pulls)

**What does it do?** This command starts [the `Git artifacts` Azure Pipeline](https://dev.azure.com/git-for-windows/git/_build?definitionId=34&_a=summary) that builds all of the artifacts of a full Git for Windows release: installer, Portable Git, MinGit, etc
**What does it do?** This command starts [the `git-artifacts` workflow](https://github.com/git-for-windows/git-for-windows-automation/actions/workflows/git-artifacts.yml) that builds all of the artifacts of a full Git for Windows release: installer, Portable Git, MinGit, etc

### `/release`

**Where can it be called?** In `git-for-windows/git`'s [Pull Requests](https://github.com/git-for-windows/git/pulls)

**What does it do?** Call this command after a `/git-artifacts` command successfully produced the artifacts _and_ after the installer artifact has been validated manually, using [the "pre-flight checklist"](https://github.com/git-for-windows/build-extra/blob/HEAD/installer/checklist.txt). This will start [the Azure Release Pipeline](https://dev.azure.com/git-for-windows/git/_release?_a=releases&view=mine&definitionId=1) to publish the artifacts in a new GitHub Release.
**What does it do?** Call this command after a `/git-artifacts` command successfully produced the artifacts _and_ after the installer artifact has been validated manually, using [the "pre-flight checklist"](https://github.com/git-for-windows/build-extra/blob/HEAD/installer/checklist.txt). This will start [the `release-git` workflow](https://github.com/git-for-windows/git-for-windows-automation/actions/workflows/release-git.yml) to publish the artifacts in a new GitHub Release.

## Spinning up Windows/ARM64 runners

Expand Down Expand Up @@ -94,7 +94,6 @@ Then, configure [the `GITHUB_*` variables](#some-environment-variables) locally,
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "node",
"AZURE_PIPELINE_TRIGGER_TOKEN": "<personal-access-token>",
"AzureWebJobsStorage": "<storage-key>",
"GITHUB_APP_ID": "<app-id>",
"GITHUB_APP_CLIENT_ID": "<client-id>",
Expand Down Expand Up @@ -128,7 +127,7 @@ After the deployment succeeded, in the "Overview" tab, there is a "Get publish p

A few environment variables will have to be configured for use with the Azure Function. This can be done on the "Configuration" tab, which is in the "Settings" group.

Concretely, the environment variables `AZURE_PIPELINE_TRIGGER_TOKEN`, `GITHUB_WEBHOOK_SECRET`, `GITHUB_APP_PRIVATE_KEY`, `GITHUB_APP_CLIENT_SECRET`, `GITHUB_APP_CLIENT_ID` and `GITHUB_APP_ID` need to be set. For the first, a generated random string was used. The private key, client secret and ID of the GitHub App are not known at this time, though, therefore they will have to be set in the Azure Function Configuration later.
Concretely, the environment variables `GITHUB_WEBHOOK_SECRET`, `GITHUB_APP_PRIVATE_KEY`, `GITHUB_APP_CLIENT_SECRET`, `GITHUB_APP_CLIENT_ID` and `GITHUB_APP_ID` need to be set. For the first, a generated random string was used. The private key, client secret and ID of the GitHub App are not known at this time, though, therefore they will have to be set in the Azure Function Configuration later.

### The repository

Expand Down
2 changes: 1 addition & 1 deletion test-pr-comment-delivery.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

// avoid accidentally triggering anything
delete process.env.GITHUB_APP_PRIVATE_KEY
delete process.env.AZURE_PIPELINE_TRIGGER_TOKEN
process.env.DO_NOT_TRIGGER_ANYTHING = 'true'

const index = require('./GitForWindowsHelper/index')
console.log(await index(context, req) || context.res)
Expand Down

0 comments on commit adc1a0e

Please sign in to comment.