collect dotnet-runtime PRs #148
This file contains hidden or 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 workflow will build a .NET project | |
| name: collect dotnet-runtime PRs | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| summarize: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| timeout-minutes: 10 | |
| outputs: | |
| has_changes: ${{ steps.commit.outputs.has_changes }} | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - name: Setup .NET | |
| uses: prozolic/Actions/.github/actions/setup-dotnet@main | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build -c Release | |
| - name: configure-pages@v4 latest PRs and create PRs. | |
| run: dotnet run --project ./src/PRDigest.NET/PRDigest.NET.csproj --no-launch-profile -c Release ./archives ./outputs -g | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| - name: Commit and push changes | |
| id: commit | |
| run: | | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add ./archives | |
| if git diff --quiet && git diff --staged --quiet; then | |
| echo "has_changes=false" >> "$GITHUB_OUTPUT" | |
| else | |
| git commit -m "Summarize latest PRs by github-actions[bot]" && git push origin main | |
| echo "has_changes=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 | |
| with: | |
| path: ./outputs/ | |
| deploy: | |
| needs: summarize | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{steps.deployment.outputs.page_url}} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 | |
| # NOTE: push with GITHUB_TOKEN won't invoke the event, | |
| # as a workaround, directly call the action. | |
| release: | |
| needs: [summarize, deploy] | |
| if: needs.summarize.outputs.has_changes == 'true' | |
| uses: ./.github/workflows/create-release.yml |