Skip to content

Commit

Permalink
Changed OPAL+ sync workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danyi1212 committed Jul 24, 2024
1 parent 163b121 commit 95df08d
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions .github/workflows/sync_opal_plus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,47 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Git configuration
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Add opal-plus repository as remote
run: |
git remote add private https://github.com/permitio/opal-plus.git
- name: Fetch private repository branches
run: |
git fetch private
- name: Rebase master onto public-master
run: |
git rebase private/public-master
- name: Push changes to public-master branch
run: |
git push private sync-test:public-master
- name: Get Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v1
with:
application_id: ${{ secrets.APPLICATION_ID }}
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}

- name: Checkout permitio/opal repository
uses: actions/checkout@v4
with:
repository: permitio/opal
ref: sync-test
path: opal
fetch-depth: 0

- name: Checkout permitio/opal-plus repository
uses: actions/checkout@v4
with:
repository: permitio/opal-plus
ref: public-master
path: opal-plus
token: ${{ steps.get_workflow_token.outputs.token }}

- name: Rebase opal-plus:public-master onto opal:master
working-directory: opal-plus
run: |
git remote add opal ../opal
git fetch opal
git checkout public-master
git rebase opal/sync-test
- name: Push changes to opal-plus public-master branch
working-directory: opal-plus
run: |
git push origin public-master
- name: Create Pull Request for opal-plus
run: |
gh pr create --assignee @me --reviewer "$GITHUB_ACTOR" --base sync-test --head public-master --title "Sync changes from public OPAL repository" --fill-verbose
Expand Down

0 comments on commit 95df08d

Please sign in to comment.