mirror of
https://github.com/lifting-bits/sleigh
synced 2026-06-21 13:56:12 +00:00
f4fe9a9c46
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
116 lines
3.6 KiB
YAML
116 lines
3.6 KiB
YAML
name: Update Ghidra Sleigh
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * 1'
|
|
|
|
# Should only be manually run on default branch (master)
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
# Use oldest supported version for maximum script compatibility
|
|
python-version: '3.10'
|
|
|
|
- name: Run Update Script
|
|
id: head_update
|
|
run: |
|
|
# Sets some outputs. See next step
|
|
python3 scripts/update_ghidra_head.py --ci
|
|
|
|
# Need this to run further Actions on the newly created PR
|
|
# See here for more details https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
|
|
- uses: actions/create-github-app-token@v3
|
|
if: steps.head_update.outputs.did_update
|
|
id: generate-token
|
|
with:
|
|
app-id: ${{ secrets.APP_ID }}
|
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
|
|
- name: Commit, push, and create PR
|
|
if: steps.head_update.outputs.did_update
|
|
env:
|
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
|
run: |
|
|
BRANCH="cron/update-ghidra-${{ steps.head_update.outputs.short_sha }}"
|
|
|
|
# Check if PR already exists for this branch
|
|
if gh pr list --head "$BRANCH" --json number --jq '.[0].number' | grep -q .; then
|
|
echo "PR already exists for branch $BRANCH, skipping"
|
|
exit 0
|
|
fi
|
|
|
|
# Configure git
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
# Create branch and commit
|
|
git checkout -b "$BRANCH"
|
|
git add -A
|
|
git commit -m "$(cat <<'EOF'
|
|
Bump Ghidra HEAD commit ${{ steps.head_update.outputs.short_sha }}
|
|
|
|
Changed files:
|
|
|
|
${{ steps.head_update.outputs.changed_files }}
|
|
|
|
Commit details:
|
|
|
|
${{ steps.head_update.outputs.commit_details }}
|
|
EOF
|
|
)"
|
|
|
|
# Push branch
|
|
git push -u origin "$BRANCH"
|
|
|
|
# Build PR body using heredoc with single-quoted delimiter to prevent
|
|
# bash from interpreting backticks in the markdown content as command
|
|
# substitution. GitHub Actions expressions are expanded before bash
|
|
# processes the script, so they still get substituted.
|
|
BASE_BODY=$(cat <<'PRBODY'
|
|
Changed files:
|
|
|
|
${{ steps.head_update.outputs.changed_files }}
|
|
|
|
Commit details:
|
|
|
|
${{ steps.head_update.outputs.commit_details }}
|
|
PRBODY
|
|
)
|
|
|
|
# Add intervention warning if needed
|
|
if [ "${{ steps.head_update.outputs.needs_manual_intervention }}" = "true" ]; then
|
|
INTERVENTION=$(cat <<'PRBODY'
|
|
## :warning: Manual Intervention Required
|
|
|
|
The following files were added or deleted and may require manual CMake configuration updates:
|
|
|
|
${{ steps.head_update.outputs.intervention_details }}
|
|
|
|
### Instructions
|
|
- **New C++ sources**: Add to appropriate list in `src/setup-ghidra-source.cmake`
|
|
- **Deleted C++ sources**: Remove from `src/setup-ghidra-source.cmake`
|
|
- **New spec files**: Review if `.slaspec` files are auto-generated; other types may need manual updates
|
|
- **Deleted spec files**: Verify no longer referenced
|
|
|
|
---
|
|
|
|
PRBODY
|
|
)
|
|
PR_BODY="${INTERVENTION}${BASE_BODY}"
|
|
else
|
|
PR_BODY="$BASE_BODY"
|
|
fi
|
|
|
|
# Create PR
|
|
gh pr create \
|
|
--title "Update Ghidra HEAD to commit ${{ steps.head_update.outputs.short_sha }}" \
|
|
--body "$PR_BODY"
|