Skip to content

Commit

Permalink
Fix: d4g-utils action for test
Browse files Browse the repository at this point in the history
  • Loading branch information
gaudinnicolas committed Feb 14, 2024
1 parent c97e9e0 commit ebad482
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/d4g-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Copy File to Organization Repos
on:
push:
paths:
- 'd4g-utils/**' # Trigger the workflow only when changes are made in the d4g-utilsdirectory
- 'd4g-utils/**' # Trigger the workflow only when changes are made in the d4g-utils directory
branches:
- main

Expand All @@ -30,17 +30,25 @@ jobs:
TOKEN=$1
# Fetch repositories from the organization
response=$(curl -s -H "Authorization: Bearer $TOKEN" "https://api.github.com/orgs/$ORG_NAME/repos")
repos=`gh repo list $ORG_NAME --limit 500 | awk ' {print $1}'`
# 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 }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Copy files to organization repos
# run: |
- name: Copy files to organization repos
run: |
echo "Searching for repositories generated from template: $template_repo"
for repo in ${{ steps.org_repos.outputs.repos }}; do
repo_info=`gh api repos/$repo`
echo "$repo_info" | jq -r ".template_repository.full_name" | grep "$template_repo" 2>&1 > /dev/null
if [ "$?" -eq "0" ]
then
echo "repo_using_template: $repo"
fi
done
# for repo in ${{ steps.org_repos.outputs.repos }}; do
# # Clone the repository
# git clone "https://github.com/$repo" target_repo
Expand Down

0 comments on commit ebad482

Please sign in to comment.