Skip to content

Commit

Permalink
MWPW-142394: Enable repo-sync for graybox (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
sukamat authored Apr 1, 2024
1 parent ea5ba14 commit a31b537
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/graybox-sync-repos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Graybox Repo Sync

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.FG_SYNC_APP_ID }}
private-key: ${{ secrets.FG_SYNC_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "bacom-graybox"

- name: Checkout Repo
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Clone Graybox Repository
run: |
git clone https://github.com/adobecom/bacom-graybox.git ../bacom-graybox
- name: Overwrite graybox repo files with latest from source repo
run: |
rsync -av --exclude='fstab.yaml' --exclude='.github' --exclude='.git' --exclude='.idea' --exclude='.husky' --exclude='.vscode' --exclude='tools/sidekick/config.json' ./ ../bacom-graybox/
- name: Commit and Push Changes to Graybox Repository
run: |
cd ../bacom-graybox
git config user.email "$FG_SYNC_BOT_EMAIL"
git config user.name "graybox-repo-sync[bot]"
git status
git remote set-url origin https://oauth2:[email protected]/adobecom/bacom-graybox.git
git remote -v
git add .
git commit -m "Syncing bacom to bacom-graybox"
git push origin main --force
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
FG_SYNC_BOT_EMAIL: ${{ secrets.FG_SYNC_BOT_EMAIL }}

0 comments on commit a31b537

Please sign in to comment.