From f933aed054813af017425995cfb9385abd9c20ba Mon Sep 17 00:00:00 2001 From: Karan Batavia <118820668+karan-batavia@users.noreply.github.com> Date: Wed, 5 Jun 2024 12:08:34 +0530 Subject: [PATCH 1/2] add token and change workflow (#21) --- .github/workflows/upstream_sync.yml | 4 +++- upstream_sync.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) mode change 100644 => 100755 upstream_sync.sh diff --git a/.github/workflows/upstream_sync.yml b/.github/workflows/upstream_sync.yml index c935b1dafdd5..38c9325de5a5 100644 --- a/.github/workflows/upstream_sync.yml +++ b/.github/workflows/upstream_sync.yml @@ -26,7 +26,9 @@ jobs: with: branch: ${{ env.LATEST_TAG }} - - run: bash ./upstream_sync.sh --branch ${{ env.LATEST_TAG }} + - run: ./upstream_sync.sh --branch ${{ env.LATEST_TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create a PR from ${{ env.LATEST_TAG }} to sync run: gh pr create --repo Privado-Inc/joern -B sync -H ${{ env.LATEST_TAG }} --title 'Test PR' --body 'Created by Github action' diff --git a/upstream_sync.sh b/upstream_sync.sh old mode 100644 new mode 100755 index b3e8ea464361..fb7b9c0be5d8 --- a/upstream_sync.sh +++ b/upstream_sync.sh @@ -2,7 +2,7 @@ set -e -git remote add upstream https://github.com/joernio/joern +git remote set-url upstream https://github.com/joernio/joern usage() { echo "Usage: $0 [--publish] [--branch ]" @@ -26,7 +26,7 @@ fi git fetch upstream -git checkout "$BRANCH" +git checkout -b "$BRANCH" git merge upstream/master git push origin "$BRANCH" From 8ec822742c691779a5ae4dabd41dd28015e6881f Mon Sep 17 00:00:00 2001 From: Karan Batavia Date: Wed, 5 Jun 2024 12:09:58 +0530 Subject: [PATCH 2/2] change back to add upstream --- upstream_sync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upstream_sync.sh b/upstream_sync.sh index fb7b9c0be5d8..4ef55d911883 100755 --- a/upstream_sync.sh +++ b/upstream_sync.sh @@ -2,7 +2,7 @@ set -e -git remote set-url upstream https://github.com/joernio/joern +git remote add upstream https://github.com/joernio/joern usage() { echo "Usage: $0 [--publish] [--branch ]"