generated from AnswerDotAI/nbdev-template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
1d7b3c7
commit 020923b
Showing
2 changed files
with
58 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Copy File to Organization Repos | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'd4g-utils/**' # Trigger the workflow only when changes are made in the d4g-utilsdirectory | ||
branches: | ||
- main | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
copy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout template repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "D4G Tech" | ||
- name: Get organization repositories | ||
id: org_repos | ||
run: | | ||
ORG_NAME="dataforgoodfr" | ||
TEMPLATE_REPO="$ORG_NAME/python_template" | ||
TOKEN=$1 | ||
# Fetch repositories from the organization | ||
response=$(curl -s -H "Authorization: Bearer $TOKEN" "https://api.github.com/orgs/$ORG_NAME/repos") | ||
# Extract repository names created from the template | ||
repos=$(echo "$response" | jq -r ".[] | select(.template_repository.full_name == \"$TEMPLATE_REPO\") | .full_name") | ||
echo "::set-output name=repos::$repos" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.D4GTECH_TOKEN }} | ||
|
||
# - name: Copy files to organization repos | ||
# run: | | ||
# for repo in ${{ steps.org_repos.outputs.repos }}; do | ||
# # Clone the repository | ||
# git clone "https://github.com/$repo" target_repo | ||
|
||
# # Copy all files from d4g-utils to target repository d4g-utlis | ||
# rsync -av --exclude='.git' d4g-utils/ target_repo/d4g-utils | ||
|
||
# # Commit and push changes | ||
# cd target_repo | ||
# git add . | ||
# git commit -m "Copy files from d4g-utils directory" | ||
# git push origin main | ||
|
||
# cd .. | ||
# done |
File renamed without changes.