dotnet-file #108
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
# Synchronizes .netconfig-configured files with dotnet-file | |
name: dotnet-file | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
push: | |
branches: [ 'dotnet-file' ] | |
env: | |
DOTNET_NOLOGO: true | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
jobs: | |
sync: | |
runs-on: windows-latest | |
steps: | |
- name: 🔍 GH_TOKEN | |
if: env.GH_TOKEN == '' | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV | |
- name: 🤘 checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: main | |
token: ${{ env.GH_TOKEN }} | |
- name: 🔄 sync | |
run: | | |
dotnet tool update -g dotnet-gcm | |
dotnet gcm store --protocol=https --host=github.com --username=$env:GITHUB_ACTOR --password=$env:GH_TOKEN | |
gh auth status | |
dotnet tool update -g dotnet-file | |
dotnet file sync -c:$env:TEMP\dotnet-file.md | |
if (test-path $env:TEMP\dotnet-file.md) { | |
echo 'CHANGES<<EOF' >> $env:GITHUB_ENV | |
cat $env:TEMP\dotnet-file.md >> $env:GITHUB_ENV | |
echo 'EOF' >> $env:GITHUB_ENV | |
cat $env:TEMP\dotnet-file.md | |
} else { | |
echo 'No changelog was generated' | |
} | |
- name: ✍ pull request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
base: main | |
branch: dotnet-file-sync | |
delete-branch: true | |
labels: dependencies | |
commit-message: ⬆️ Bump files with dotnet-file sync | |
${{ env.CHANGES }} | |
title: "Bump files with dotnet-file sync" | |
body: ${{ env.CHANGES }} | |
token: ${{ env.GH_TOKEN }} |