-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ concurrency: | |
on: | ||
push: | ||
branches: | ||
- ad/chore/better-noir-sync | ||
# paths: | ||
# - 'noir/**' | ||
# - '!noir/.gitrepo' | ||
- master | ||
paths: | ||
- 'noir/**' | ||
- '!noir/.gitrepo' | ||
|
||
jobs: | ||
mirror_repo: | ||
|
@@ -43,10 +43,10 @@ jobs: | |
- name: Push to branch | ||
run: | | ||
set -xue # print commands | ||
# Enable gh executable. | ||
export GH_TOKEN="${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}" | ||
# Enable gh executable. We spread out the API requests between the github actions bot token, and aztecbot | ||
export GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" | ||
SUBREPO_PATH=noir | ||
BRANCH=aztec2-packages | ||
BRANCH=aztec-packages | ||
# identify ourselves, needed to commit | ||
git config --global user.name AztecBot | ||
git config --global user.email [email protected] | ||
|
@@ -66,7 +66,7 @@ jobs: | |
if [[ " $COMMIT_HEURISTIC" = "" ]] ; then | ||
COMMIT_HEURISTIC=$BASE_AZTEC_COMMIT | ||
fi | ||
MESSAGE=$(git log --pretty=format:"%s" $COMMIT_HEURISTIC..HEAD -- noir/ ':!noir/.gitrepo' | grep -v 'git subrepo || true') | ||
MESSAGE=$(git log --pretty=format:"%s" $COMMIT_HEURISTIC..HEAD -- noir/ ':!noir/.gitrepo' | grep -v 'git subrepo' || true) | ||
# Fix Aztec PR links | ||
MESSAGE=$(echo "$MESSAGE" | sed -E 's/\(#([0-9]+)\)/(https:\/\/github.com\/AztecProtocol\/aztec-packages\/pull\/\1)/g') | ||
git commit --allow-empty -m"chore: Sync to noir-lang/noir" -m"$MESSAGE" | ||
|
@@ -84,9 +84,11 @@ jobs: | |
PR_BODY="""BEGIN_COMMIT_OVERRIDE | ||
$MESSAGE | ||
END_COMMIT_OVERRIDE""" | ||
PR_URL=$(gh pr list --repo noir-lang/noir --head aztec2-packages --json url --jq ".[0].url") | ||
PR_URL=$(gh pr list --repo noir-lang/noir --head aztec-packages --json url --jq ".[0].url") | ||
# for cross-opening PR in noir repo, we use aztecbot's token | ||
export GH_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | ||
if [[ "$PR_URL" == "" ]]; then | ||
gh pr create --repo noir-lang/noir --title "feat: Sync from aztec-packages" --body "$PR_BODY" --base master --head aztec2-packages | ||
gh pr create --repo noir-lang/noir --title "feat: Sync from aztec-packages" --body "$PR_BODY" --base master --head aztec-packages | ||
else | ||
gh pr edit "$PR_URL" --body "$PR_BODY" | ||
fi | ||
fi |