-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync all branches #13
Comments
@TobKed
If I encounter problems in the future, I will come back and submit again. |
@GWen124 no probs, I am not a native English speaker as well :)
What do you mean by cloning all branches?
What do you meean by |
OK, thank you very much. I found the problem again later, and I'm coming to submit it. Regarding the cloning of the entire warehouse branch, I don't know how to explain it. Let's take your warehouse as an example. These are the three branches of your warehouse. How can I clone them at once? |
For example, the main branch of your warehouse is "master" and the other branch is "18.06". How can I clone it at one time? After all, some authors use branches to distinguish versions. |
@GWen124 name: Sync all branches
on:
workflow_dispatch:
jobs:
generate-matrix:
name: Generate matrix of branches
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set matrix of branches
id: set-matrix
run: |
upstream_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${INPUT_UPSTREAM_REPOSITORY}.git"
upstream_dir=${INPUT_UPSTREAM_REPOSITORY##*/}
git clone "${upstream_repo}"
cd "${upstream_dir}"
JSON="{\"branch\":["
for branch in `git branch -a | grep remotes | grep -v HEAD`; do
branch_trimmed=$(echo -e $branch | sed -e "s/remotes\/origin\///g")
JSON="$JSON\"${branch_trimmed}\","
done
if [[ $JSON == *, ]]; then
JSON="${JSON%?}"
fi
JSON="$JSON]}"
echo $JSON | jq
echo "::set-output name=matrix::$( echo "$JSON" )"
env:
INPUT_GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
INPUT_UPSTREAM_REPOSITORY: apache/airflow
update_external_airflow_fork:
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
fail-fast: false
steps:
- uses: TobKed/github-forks-sync-action@master
with:
github_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
upstream_repository: apache/airflow
target_repository: TobKed/airflow
upstream_branch: ${{ matrix.branch }}
target_branch: ${{ matrix.branch }}
force: true
tags: true |
ok, thanks a lot |
I added example to README in #16 and I am closing this issue for now. |
No description provided.
The text was updated successfully, but these errors were encountered: