From 1ed2ed382c00c0ec5b243860137ae974133738c5 Mon Sep 17 00:00:00 2001 From: roblabla Date: Fri, 29 Sep 2023 20:31:01 +0200 Subject: [PATCH] Fix mapping update CI, and split it from export --- .github/workflows/export-ghidra.yml | 15 ----------- .github/workflows/update-mapping.yml | 40 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/update-mapping.yml diff --git a/.github/workflows/export-ghidra.yml b/.github/workflows/export-ghidra.yml index c5253b8a..8109e5d4 100644 --- a/.github/workflows/export-ghidra.yml +++ b/.github/workflows/export-ghidra.yml @@ -11,7 +11,6 @@ jobs: permissions: contents: write - pull-requests: write steps: - uses: actions/checkout@v4 @@ -33,20 +32,6 @@ jobs: curl -L https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.3.3_build/ghidra_10.3.3_PUBLIC_20230829.zip -o /tmp/ghidra.zip unzip -d /tmp /tmp/ghidra.zip echo /tmp/ghidra_*/support >> $GITHUB_PATH - - name: Update mapping - run: | - echo "$GHIDRA_SSH_AUTH" > ssh_key - python scripts/update_mapping.py --username github-action --ssh-key ssh_key --program th06_102h.exe 'ghidra://roblab.la/Touhou 06' - rm ssh_key - env: # Or as an environment variable - GHIDRA_SSH_AUTH: ${{ secrets.GHIDRA_SSH_AUTH }} - - name: Create PR to TH06 with updated mapping - uses: peter-evans/create-pull-request@v5 - with: - commit-message: Update mapping to latest ghidra changes - branch: update-mapping - title: Update mapping from ghidra - body: Updates the mapping to the latest changes in the ghidra database. - name: Export ghidra run: | echo "$GHIDRA_SSH_AUTH" > ssh_key diff --git a/.github/workflows/update-mapping.yml b/.github/workflows/update-mapping.yml new file mode 100644 index 00000000..f95bba74 --- /dev/null +++ b/.github/workflows/update-mapping.yml @@ -0,0 +1,40 @@ +name: Update mapping file + +on: + workflow_dispatch: + schedule: + - cron: '0 2 * * *' + +jobs: + update-mapping: + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v4 + - name: Install python 3.11 + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Get ghidra + run: | + curl -L https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.3.3_build/ghidra_10.3.3_PUBLIC_20230829.zip -o /tmp/ghidra.zip + unzip -d /tmp /tmp/ghidra.zip + echo /tmp/ghidra_*/support >> $GITHUB_PATH + - name: Update mapping + run: | + echo "$GHIDRA_SSH_AUTH" > ssh_key + python scripts/update_mapping.py --username github-action --ssh-key ssh_key --program th06_102h.exe 'ghidra://roblab.la/Touhou 06' + rm ssh_key + env: # Or as an environment variable + GHIDRA_SSH_AUTH: ${{ secrets.GHIDRA_SSH_AUTH }} + - name: Create PR to TH06 with updated mapping + uses: peter-evans/create-pull-request@v5 + with: + commit-message: Update mapping to latest ghidra changes + branch: update-mapping + title: Update mapping from ghidra + body: Updates the mapping to the latest changes in the ghidra database.