From d57a54789e72c44d0eeb5fed23d4644a76b43ef4 Mon Sep 17 00:00:00 2001 From: Wannes Gennar Date: Sun, 5 Jul 2026 23:04:35 +0200 Subject: [PATCH 1/2] chore: update Github Actions --- .github/workflows/codeql.yml | 2 +- .github/workflows/dotnet.yml | 8 ++++---- .github/workflows/fly.yml | 2 +- .github/workflows/pages.yml | 10 +++++----- .github/workflows/sync.yml | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index de9fd9e..1a45c0a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -56,7 +56,7 @@ jobs: # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: submodules: 'recursive' diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c1a2b54..74bc483 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -18,9 +18,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5.4 with: dotnet-version: 10.0.x - name: download JSON submodule @@ -35,7 +35,7 @@ jobs: run: dotnet test --no-build --verbosity normal - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: retention-days: 5 name: openapi-schemas @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: submodules: true - name: Set up Docker Buildx diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml index 2ce076e..17fa9fa 100644 --- a/.github/workflows/fly.yml +++ b/.github/workflows/fly.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest concurrency: deploy-group # optional: ensure only one action runs at a time steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: superfly/flyctl-actions/setup-flyctl@master diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 14ad50e..581cc3a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -25,11 +25,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Initial static JSON schema submodule run: git submodule update --init ./src/Helldivers-2-Models/json - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5.4 with: dotnet-version: 10.0.x - name: Generate OpenAPI JSON files @@ -54,11 +54,11 @@ jobs: name: 'docs' path: '.' - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@v6 - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: '.' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 839232d..1ac4efc 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -18,10 +18,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5.4 with: dotnet-version: '10.0.x' @@ -39,7 +39,7 @@ jobs: - name: Upload artifacts if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: sync-artifacts path: | @@ -58,7 +58,7 @@ jobs: - name: Comment on PR on failure if: ${{ steps.run_sync.outcome == 'failure' && github.event_name == 'pull_request' }} - uses: peter-evans/create-or-update-comment@v4 + uses: peter-evans/create-or-update-comment@v5 with: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} From d32bdf5ab9b9b056a9ac6f32256b9a61a36485bc Mon Sep 17 00:00:00 2001 From: Wannes Gennar Date: Sun, 5 Jul 2026 23:04:44 +0200 Subject: [PATCH 2/2] feat: add auto update JSON module --- .github/workflows/dotnet.yml | 2 +- .github/workflows/pages.yml | 2 +- .github/workflows/sync.yml | 2 +- .github/workflows/update-json.yml | 70 +++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/update-json.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 74bc483..ae2081b 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v7 - name: Setup .NET - uses: actions/setup-dotnet@v5.4 + uses: actions/setup-dotnet@v5 with: dotnet-version: 10.0.x - name: download JSON submodule diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 581cc3a..764835c 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -29,7 +29,7 @@ jobs: - name: Initial static JSON schema submodule run: git submodule update --init ./src/Helldivers-2-Models/json - name: Setup .NET - uses: actions/setup-dotnet@v5.4 + uses: actions/setup-dotnet@v5 with: dotnet-version: 10.0.x - name: Generate OpenAPI JSON files diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 1ac4efc..362f5f7 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v7 - name: Setup .NET - uses: actions/setup-dotnet@v5.4 + uses: actions/setup-dotnet@v5 with: dotnet-version: '10.0.x' diff --git a/.github/workflows/update-json.yml b/.github/workflows/update-json.yml new file mode 100644 index 0000000..0e1cffd --- /dev/null +++ b/.github/workflows/update-json.yml @@ -0,0 +1,70 @@ +name: Update JSON data submodule + +on: + repository_dispatch: + types: [json-data-updated] + workflow_dispatch: {} + +permissions: + contents: write + pull-requests: write + issues: write + +jobs: + update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + submodules: recursive + fetch-depth: 0 + + - name: Update submodule to latest + id: update + run: | + git submodule update --remote --merge src/Helldivers-2-Models/json + if git diff --quiet; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Setup .NET + if: steps.update.outputs.changed == 'true' + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.x' # match whatever your Directory.Build.props/global.json targets + + - name: Build and test + if: steps.update.outputs.changed == 'true' + id: build + continue-on-error: true + run: | + dotnet restore Helldivers-2.sln + dotnet build Helldivers-2.sln --no-restore --configuration Release + dotnet test Helldivers-2.sln --no-build --configuration Release + + - name: Open PR if build succeeded + if: steps.update.outputs.changed == 'true' && steps.build.outcome == 'success' + uses: peter-evans/create-pull-request@v8 + with: + commit-message: "chore: update JSON data submodule" + title: "chore: update JSON data submodule" + body: | + Automated update of `src/Helldivers-2-Models/json` to the latest commit on `master`. + Build and tests passed. + branch: auto/update-json-submodule + delete-branch: true + + - name: Open issue if build failed + if: steps.update.outputs.changed == 'true' && steps.build.outcome == 'failure' + uses: actions/github-script@v9 + with: + script: | + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: "Build failure after JSON submodule auto-update", + body: `The automated submodule update to \`src/Helldivers-2-Models/json\` broke the build.\n\nWorkflow run: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, + labels: ["automated", "build-failure"] + })