Update Class1.cs #8
Workflow file for this run
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
# https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-format | ||
name: .NET 8.0 dotnet-format | ||
on: | ||
# pushトリガーだと `context.head_ref` が取得できない | ||
# push: | ||
# branches: | ||
# - main | ||
# paths: | ||
# - 'dotnet/net8.0/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'dotnet/net8.0/**' | ||
workflow_dispatch: | ||
env: | ||
DOTNET_FORMAT_VERBOSITY: diag | ||
BASE_BRANCH: ${{ context.head_ref }} | ||
Check failure on line 20 in .github/workflows/net80-dotnet-format.yml GitHub Actions / .NET 8.0 dotnet-formatInvalid workflow file
|
||
HEAD_BRANCH: dotnet-format-${{ github.run_id }} | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
run-dotnet-format: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: 'dotnet/net8.0' | ||
outputs: | ||
base-branch-name: ${{ steps.commit-step.outputs.base-branch-name }} | ||
head-branch-name: ${{ steps.commit-step.outputs.head-branch-name }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.0.x' | ||
dotnet-quality: 'preview' | ||
- name: Format on branch | ||
id: commit-step | ||
run: | | ||
dotnet format consoleapp/consoleapp.csproj --no-restore --verbosity $DOTNET_FORMAT_VERBOSITY | ||
# dotnet format razorpageapp/razorpageapp.csproj --no-restore --verbosity $DOTNET_FORMAT_VERBOSITY | ||
git checkout -b $HEAD_BRANCH | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
git add . | ||
git commit -m "[bot] Auto formatted" | ||
git push --set-upstream origin $HEAD_BRANCH | ||
# git checkout main | ||
echo "base-branch-name: $BASE_BRANCH" | ||
echo "base-branch-name=$BASE_BRANCH" >> $GITHUB_OUTPUT | ||
echo "head-branch-name: $HEAD_BRANCH" | ||
echo "head-branch-name=$HEAD_BRANCH" >> $GITHUB_OUTPUT | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
call-pull-request-workflow: | ||
name: Call pull request workflow | ||
needs: run-dotnet-format | ||
uses: ./.github/workflows/github-pull-request-creation.yml | ||
with: | ||
base-branch-name: ${{ needs.run-dotnet-format.outputs.base-branch-name }} | ||
head-branch-name: ${{ needs.run-dotnet-format.outputs.head-branch-name }} | ||
show-pull-request-url: | ||
name: Show pull request url | ||
needs: call-pull-request-workflow | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo ${{ needs.call-pull-request-workflow.outputs.pull-request-url }} |