Files
WELA/.github/workflows/create-csv.yml
T
Shirofune-SecurityandClaude Opus 4.8 07c9e10cbf chore(ci): update GitHub Actions and SHA-pin docs.yml
Updates GitHub Actions to their latest releases and switches
.github/workflows/docs.yml from floating major tags to commit-SHA pins, so
every actions/* reference is pinned by SHA with a version comment (matching
the convention used in the other workflows).

- actions/checkout          v6.0.2       -> v7.0.1  (docs.yml was already @v7)
- actions/setup-python       v6 / v6.3.0 -> v7.1.0
- actions/setup-node        v6.4.0       -> v7.1.0
- actions/upload-artifact    v7.0.1      -> v7.0.2
- actions/configure-pages                -> v6.0.0 (SHA-pinned)
- actions/upload-pages-artifact          -> v5.0.0 (SHA-pinned)
- actions/deploy-pages                   -> v5.0.1 (SHA-pinned)

peter-evans/create-pull-request (v8.1.1) and
peter-evans/enable-pull-request-automerge (v3.0.0) are already on their
latest releases and left unchanged.

Safe for our usage: checkout v7 only changes pull_request_target /
workflow_run behavior (unused here); setup-python v7 drops the unused
pip-install input (both usages pass only python-version / cache).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-24 00:37:29 +09:00

62 lines
2.2 KiB
YAML

name: Create auditpol_output.csv
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
matrix:
os: [windows-2022, windows-2025]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Generate csv from auditpol /list /subcategory:* /r
run: |
$data = auditpol /list /subcategory:* /r
$output = @()
$category = ""
foreach ($line in $data) {
if ($line -match "^Category/Subcategory") { continue }
if ($line -match "^\s+(.+),\{(.+)\}$") {
$subcategory = $matches[1].Trim()
$guid = $matches[2].Trim()
$output += [PSCustomObject]@{
Category = $category
Subcategory = $subcategory
GUID = $guid
}
} elseif ($line -match "^(.+),\{(.+)\}$") {
$category = $matches[1].Trim()
$guid = $matches[2].Trim()
$output += [PSCustomObject]@{
Category = $category
Subcategory = ""
GUID = $guid
}
}
}
$output | Export-Csv -Path "config/eid_subcategory_mapping-org.csv" -NoTypeInformation -Encoding UTF8
$output | Format-Table -AutoSize
- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Commit changes
run: |
# 生成先は config/ 配下なので、ルート直下の *.csv では拾えない
git add config/*.csv
# git diff-index の終了コードを見る($? を使わないと出力の真偽値判定になってしまう)
git diff-index --quiet HEAD
if ($LASTEXITCODE -eq 0) {
echo "No changes to commit"
} else {
git commit -m "Automated update"
git push origin main
}