WF
This commit is contained in:
parent
165440bb99
commit
8844a1800d
51
.github/workflows/move-to-main-repo.yaml
vendored
51
.github/workflows/move-to-main-repo.yaml
vendored
@ -70,15 +70,46 @@ jobs:
|
|||||||
git config --global user.email "github-actions@github.com"
|
git config --global user.email "github-actions@github.com"
|
||||||
git config --global user.name "GitHub Actions"
|
git config --global user.name "GitHub Actions"
|
||||||
|
|
||||||
- name: Tets
|
- name: Create PR if files found
|
||||||
uses: nkoppel/push-files-to-another-repository@v1.1.4
|
if: env.files_found == 'true'
|
||||||
env:
|
env:
|
||||||
API_TOKEN_GITHUB: ${{ secrets.MAIN_REPO_WF_PERSONAL }}
|
GH_TOKEN: ${{ secrets.MAIN_REPO_WF }}
|
||||||
|
run: |
|
||||||
|
script_name="wf-test"
|
||||||
|
|
||||||
|
target_repo="community-scripts/ProxmoxVE"
|
||||||
|
|
||||||
|
branch_name="add-script-$script_name"
|
||||||
|
echo "branch=$branch_name" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
commit_message="Add script files for $script_name"
|
||||||
|
|
||||||
|
|
||||||
|
git checkout -b "$branch_name"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cp "ct/$script_name.sh" .
|
||||||
|
cp "install/$script_name-install.sh" .
|
||||||
|
cp "json/$script_name.json" .
|
||||||
|
|
||||||
|
git add .
|
||||||
|
|
||||||
|
git commit -m "$commit_message"
|
||||||
|
|
||||||
|
git status
|
||||||
|
|
||||||
|
git push origin "$branch_name"
|
||||||
|
|
||||||
|
- name: Open PR
|
||||||
|
id: open_pr
|
||||||
|
uses: rematocorp/open-pull-request-action@v1
|
||||||
with:
|
with:
|
||||||
source-files: "ct/${{ env.script_name }}.sh,install/${{ env.script_name }}-install.sh,json/${{ env.script_name }}.json"
|
github-token: ${{ secrets.MAIN_REPO_WF }}
|
||||||
destination-repository: "community-scripts/ProxmoxVE"
|
from-branch: ${{ env.branch }}
|
||||||
destination-branch: "main"
|
to-branch: main
|
||||||
commit-message: "Add script files for ${{ env.script_name }}"
|
repository-owner: communtiy-scripts
|
||||||
destination-username: "github-actions"
|
repository: ProxmoxVE
|
||||||
commit-email: "github-actions@github.com"
|
|
||||||
commit-username: "GitHub Actions"
|
- name: Echo mergeable PR number
|
||||||
|
run: echo ${{ steps.open_pr.outputs.pull_number }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user