This commit is contained in:
46
.gitea/workflows/log-push.yml
Normal file
46
.gitea/workflows/log-push.yml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Log every push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
log-push:
|
||||||
|
runs-on: windows
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: powershell
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Append push info to txt log
|
||||||
|
env:
|
||||||
|
PUSHER: ${{ gitea.actor }}
|
||||||
|
REF: ${{ gitea.ref }}
|
||||||
|
REPO: ${{ gitea.repository }}
|
||||||
|
COMMITS_JSON: ${{ toJson(github.event.commits) }}
|
||||||
|
run: |
|
||||||
|
$logDir = "C:\gitea-logs"
|
||||||
|
$logFile = Join-Path $logDir "push-log.txt"
|
||||||
|
|
||||||
|
New-Item -ItemType Directory -Path $logDir -Force | Out-Null
|
||||||
|
|
||||||
|
$branch = $env:REF -replace '^refs/heads/', ''
|
||||||
|
$time = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
||||||
|
|
||||||
|
Add-Content -Path $logFile -Value "========================================"
|
||||||
|
Add-Content -Path $logFile -Value "Time: $time"
|
||||||
|
Add-Content -Path $logFile -Value "Repo: $env:REPO"
|
||||||
|
Add-Content -Path $logFile -Value "Pusher: $env:PUSHER"
|
||||||
|
Add-Content -Path $logFile -Value "Branch: $branch"
|
||||||
|
Add-Content -Path $logFile -Value "Commits:"
|
||||||
|
|
||||||
|
$commits = $env:COMMITS_JSON | ConvertFrom-Json
|
||||||
|
|
||||||
|
foreach ($commit in $commits)
|
||||||
|
{
|
||||||
|
Add-Content -Path $logFile -Value " - SHA: $($commit.id)"
|
||||||
|
Add-Content -Path $logFile -Value " Author: $($commit.author.name) <$($commit.author.email)>"
|
||||||
|
Add-Content -Path $logFile -Value " Message: $($commit.message)"
|
||||||
|
}
|
||||||
|
|
||||||
|
Add-Content -Path $logFile -Value ""
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Reference in New Issue
Block a user