Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

dotnet-file

dotnet-file #868

Workflow file for this run

# Synchronizes .netconfig-configured files with dotnet-file
name: dotnet-file
on:
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
commit-message: Bump files with dotnet-file sync
${{ env.CHANGES }}
title: "Bump files with dotnet-file sync"
body: ${{ env.CHANGES }}
token: ${{ env.GH_TOKEN }}