Skip to content

Commit

Permalink
Sync Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Foundation Platform Bot - Sync Repos committed Sep 12, 2024
1 parent a3c2d22 commit 12a91e2
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @stone-payments/github-support
81 changes: 81 additions & 0 deletions .github/workflows/sync-repositories.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Sync Repositories

on:
push:
branches:
- main

jobs:
sync-repos:
if: github.repository_owner == 'stone-payments'
runs-on: ubuntu-latest
strategy:
matrix:
repo: [
"pagarme/.github",
"mundipagg/.github",
"dlpco/.github",
"stone-ton/.github"
]

steps:

- name: Extract Repository Info
id: extract-info
run: |
IFS='/' read -r org repo <<< "${{ matrix.repo }}"
echo "ORG=$org" >> $GITHUB_ENV
echo "REPO=$repo" >> $GITHUB_ENV
- name: Generate GitHub App Token
id: app-token-stone-payments
uses: actions/create-github-app-token@v1
with:
app-id: 996272
private-key: ${{ secrets.GH_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ env.REPO }}

- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.app-token-stone-payments.outputs.token }}
path: "${{github.repository_owner}}-${{ env.REPO }}"

- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: 996272
private-key: ${{ secrets.GH_PRIVATE_KEY }}
owner: ${{ env.ORG }}
repositories: ${{ env.REPO }}

- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
repository: "${{ env.ORG }}/${{ env.REPO }}"
path: "${{ env.ORG }}-${{ env.REPO }}"

- name: Update Repository
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
# Config Git
echo "Configuring Git..."
git config --global user.email "[email protected]"
git config --global user.name "Foundation Platform Bot - Sync Repos"
# Update Repository on Another Organization
echo "Updating Repository..."
cp -r "${{github.repository_owner}}-${{ env.REPO }}"/* "${{ env.ORG }}-${{ env.REPO }}"/
cp -r "${{github.repository_owner}}-${{ env.REPO }}"/.github "${{ env.ORG }}-${{ env.REPO }}"/
cd "${{ env.ORG }}-${{ env.REPO }}"
# Commit and Push
echo "Commit and Push..."
git add .
git commit -m "Sync Repository"
git push origin main
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# .github
# Public `.github` repository

GitHub home page of Stone Enterprise Companies.

Synced from [stone-payments/.github](https://github.com/stone-payments)
11 changes: 11 additions & 0 deletions profile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
![Banner contendo uma edição do Octocat que é mascote do GitHub com roupas e acessórios da Stone](assets/banner.png)

🇺🇸 We are preparing an incredible page for you who would like to know a little more about Stone Pagamentos.

🇧🇷 Estamos preparando uma página incrível para você que deseja conhecer um pouco mais sobre a Stone Pagamentos.

---

🇺🇸 If you are a Stone contributor and are looking for inside information, make sure you select the Members option on the right. [Click here](https://github.com/stone-payments?view_as=member) click here to be redirected.

🇧🇷 Se você é colaborador da Stone e está procurando informações internas verifique se selecionou a opção para Membros no canto direito. [Clique aqui](https://github.com/stone-payments?view_as=member) clique aqui para ser redirecionado.
Binary file added profile/assets/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 12a91e2

Please sign in to comment.