Merge pull request #1114 from dotnet/publish-3176

This commit is contained in:
Bill Wagner
2021-07-17 05:38:43 -04:00
committed by GitHub
2 changed files with 29 additions and 7 deletions
+10 -7
View File
@@ -18,13 +18,14 @@ on:
- "**.vbproj"
- "**.fsproj"
- "**.vcxproj"
- "**.sln"
- "**global.json"
- "**snippets.5000.json"
branches: '*'
env:
DOTNET_INSTALLER_CHANNEL: 'release/5.0.1xx'
DOTNET_DO_INSTALL: 'false'
DOTNET_INSTALLER_CHANNEL: '6.0'
DOTNET_DO_INSTALL: 'true'
EnableNuGetPackageRestore: 'True'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
@@ -40,14 +41,19 @@ jobs:
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 #@v2
# Get the latest preview SDK (or sdk not installed by the runner)
- name: Setup .NET Core SDK Preview
- name: Setup .NET SDK
if: ${{ env.DOTNET_DO_INSTALL == 'true' }}
run: |
echo "Downloading dotnet-install.ps1"
Invoke-WebRequest https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.ps1 -OutFile dotnet-install.ps1
echo "Installing dotnet version ${{ env.DOTNET_INSTALLER_CHANNEL }}"
.\dotnet-install.ps1 -InstallDir "c:\program files\dotnet" -Channel "${{ env.DOTNET_INSTALLER_CHANNEL }}"
# Print dotnet info
- name: Display .NET info
run: |
dotnet --info
# Install locate projs global tool
- name: Install LocateProjects tool
run: |
@@ -72,6 +78,3 @@ jobs:
- name: Report status
run: |
./.github/workflows/dependencies/Out-GithubActionStatus.ps1
+19
View File
@@ -0,0 +1,19 @@
on: [pull_request_target]
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v4
env:
SHOULD_COMMENT: ${{ github.base_ref == 'refs/heads/live' && !(github.event.issue.user.login == 'cxwtool' || github.head_ref == 'refs/heads/main') }}
with:
script: |
if (process.env.SHOULD_COMMENT == 'true') {
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'It looks like this pull request may have been opened on the `live` branch by mistake. In general, PRs should target the `main` branch.'
})
}