-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1167 from dotnet/main
✅ Merge `main` into `live`
- Loading branch information
Showing
6 changed files
with
72 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: go-live | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
reason: | ||
description: "The reason for running the workflow" | ||
required: true | ||
default: "Need to update live now, before daily scheduled run." | ||
|
||
jobs: | ||
go-live: | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: "Print manual run reason" | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
echo 'Reason: ${{ github.event.inputs.reason }}' | ||
- name: Check out code | ||
uses: actions/checkout@main | ||
|
||
- name: Check for existing PR | ||
id: exists | ||
run: | | ||
result=$(gh pr list --base live --head main --json number --jq '.[0].number' || echo "") | ||
echo "PR_NUMBER=$result" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Create pull request | ||
id: create | ||
if: steps.exists.outputs.PR_NUMBER == '' | ||
run: | | ||
gh pr create \ | ||
--title "✅ Merge \`main\` into \`live\`" \ | ||
--body "🤖 Queue merge when ready..." \ | ||
--base live \ | ||
--head main | ||
echo "CREATED=true" >> $GITHUB_OUTPUT | ||
- name: Enable auto-merge for the pull request | ||
if: steps.create.outputs.CREATED == 'true' | ||
run: | | ||
PR_NUMBER=$(gh pr list --base live --head main --json number --jq '.[0].number') | ||
gh pr merge $PR_NUMBER --merge --auto |
This file contains 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
This file contains 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
This file contains 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
This file contains 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