I'm having some trouble setting up a proper build chain for me and some friends. So, I forked two repos, the official ghidra and ghidra-ci. ghidra-ci is an repo which builds your fork of ghidra, when you cherry-pick some pr's so, you can add some things which aren't added to the official ghidra repo yet.
So, ghidra-ci should build the ghidra repo when the ghidra repo is updated. So far I managed to get it to build when ghidra-ci itself is updatet. I used
name: Ghidra Build
on: [push, pull_request]
(After this are only the build jobs)
So, I know this is wrong.
I deleted the on: line, but I it wants a on: line, I just pasted on: [workflow_dispatch] in. I don't know if this is gonna work.
I have a workflow called "Check for new commits"
name: Check for new commits
on:
schedule:
- cron: '30 12 * * *'
workflow_dispatch:
inputs: {}
jobs:
# Ensure all steps use a common revision
check:
name: Check for new commits since last release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: Lockna/Ghidra
- name: Check for new commits
id: check
run: |
LAST_REL_NAME=$(curl --silent "https://api.github.com/repos/${{github.repository}}/releases/latest" | jq .name)
LAST_REL_COMMITID=$(echo $LAST_REL_NAME | grep -oP "\(\K\w+(?=\))")
COMMIT_HASH_SHORT=$(git rev-parse --short HEAD)
COMMIT_HASH_LONG=$(git rev-parse HEAD)
echo "Latest commit is $COMMIT_HASH_LONG"
if [[ "$LAST_REL_NAME" == *"$COMMIT_HASH_SHORT"* ]]; then
echo "No commits since last release $LAST_REL_NAME"
else
echo "Found new commits since $LAST_REL_NAME. Triggering ci."
echo ::set-output name=trigger::true
echo ::set-output name=rev::$COMMIT_HASH_LONG
echo ::set-output name=lastrev::$LAST_REL_COMMITID
fi
- name: Trigger build
if: steps.check.outputs.trigger
uses: benc-uk/workflow-dispatch@v1.1
with:
workflow: "Ghidra Build"
repo: Lockna/ghidra-ci
token: ${{secrets.PAT_TOKEN}}
inputs: '{ "rev": "${{steps.check.outputs.rev}}", "prevRev": "${{steps.check.outputs.lastrev}}" }'
so, this workflow should check (I would prefer that it triggers when I'm updating the ghidra itself, but I have found out that this doesn't work out as I would like to) if there are some changes and if there are some it should trigger the "Ghidra Build" workflow. For testing I run this build manually
Run benc-uk/workflow-dispatch@v1.1
with:
workflow: Ghidra Build
repo: Lockna/ghidra-ci
token: ***
inputs: { "rev": "c1a1674214007bf467dd90f6d80fda453d25b16c", "prevRev": "133d6c2" }
Workflow id is: 3932827
Error: Unexpected inputs provided
That's the error message I get. I don't know what else I could try to get this work. If someone has a solution where it really builds when ghidra repo is updated, I would like to hear that.