Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mirror_noir_subrepo.yml #4550

Merged
merged 6 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .github/workflows/mirror_noir_subrepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Get noir master's last sync commit
id: last_merge_hash
uses: actions/github-script@v7
with:
script: |
// NOTE: more robust heuristic needed if aztecbot opens different kinds of PRs
const response = await github.rest.search.commits({
q: 'author:AztecBot committer:web-flow repo:noir-lang/noir sort:committer-date'
});
console.log(response.data.items);
return response.data.items[0].sha;

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}


- name: Setup env
run: |
set -xue # print commands
Expand All @@ -55,7 +42,8 @@ jobs:
LAST_MERGED_PR_HASH=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json headRefOid --jq=.[0].headRefOid`
# Use a commit heuristic where we look at when .gitrepo first started to look at that commit state (through a push)
COMMIT_HEURISTIC=$(git log -p -S"$LAST_MERGED_PR_HASH" --reverse --source -- noir/.gitrepo | grep -m 1 '^commit' | awk '{print $2}' || true)
if [[ " $COMMIT_HEURISTIC" = "" ]] ; then
BASE_AZTEC_COMMIT=`git config --file=noir/.gitrepo subrepo.parent`
if [[ "$COMMIT_HEURISTIC" = "" ]] ; then
# It it fails, just use our gitrepo parent commit (last time we pushed or pulled)
COMMIT_HEURISTIC=$BASE_AZTEC_COMMIT
fi
Expand Down
Loading