Struct Update #85
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
name: Struct Update | |
on: | |
schedule: | |
- cron: '0 0 * * 1' | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'aers' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore | |
run: dotnet restore | |
- name: Run CExporter | |
working-directory: ./ | |
run: dotnet run --project CExporter/CExporter.csproj -c Release | |
- name: Check for changes | |
id: git-check | |
run: | | |
echo "========== check paths of modified files ==========" | |
git diff --name-only -- ida > files.txt | |
echo "=============== list modified files ===============" | |
tail files.txt | |
while IFS= read -r file | |
do | |
echo $file | |
if [[ $file != ida/* ]]; then | |
echo "This modified file is not under the 'ida' folder." | |
echo "has_changes=false" >> $GITHUB_OUTPUT | |
break | |
else | |
echo "has_changes=true" >> $GITHUB_OUTPUT | |
fi | |
done < files.txt | |
rm files.txt | |
- name: Commit C Structs | |
if: steps.git-check.outputs.has_changes == 'true' | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git add . | |
git commit -m "Update structs" | |
git push |