-
Notifications
You must be signed in to change notification settings - Fork 0
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
7de77f2
commit 0b244c5
Showing
4 changed files
with
73 additions
and
9 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,66 @@ | ||
name: Auto PR to infos folder | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "info.json" | ||
|
||
jobs: | ||
create-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source repository | ||
uses: actions/checkout@v4 | ||
with: | ||
path: source-repo | ||
|
||
- name: Get filename from info.json | ||
id: get-filename | ||
run: | | ||
cd source-repo | ||
BASE_NAME=$(jq -r '.name' info.json) | ||
FILENAME="${BASE_NAME}.json" | ||
echo "filename=$FILENAME" >> $GITHUB_OUTPUT | ||
echo "branch_name=update-file-$(date +%s)" >> $GITHUB_OUTPUT | ||
cp info.json ../target.json | ||
- name: Checkout target repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ExpTechTW/TREM-Plugins | ||
token: ${{ secrets.PAT_TOKEN }} | ||
path: target-repo | ||
|
||
- name: Copy and commit file | ||
run: | | ||
mkdir -p target-repo/infos | ||
mv target.json "target-repo/infos/${{ steps.get-filename.outputs.filename }}" | ||
cd target-repo | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
BRANCH_NAME="${{ steps.get-filename.outputs.branch_name }}" | ||
git checkout -b $BRANCH_NAME | ||
git add infos | ||
if ! git diff --cached --quiet; then | ||
git commit -m "Update ${{ steps.get-filename.outputs.filename }}" | ||
git push origin $BRANCH_NAME | ||
else | ||
echo "No changes to commit." | ||
exit 0 | ||
fi | ||
- name: Create Pull Request | ||
if: success() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | ||
run: | | ||
pr_url=$(gh pr create \ | ||
--repo ExpTechTW/TREM-Plugins \ | ||
--base main \ | ||
--head ${{ steps.get-filename.outputs.branch_name }} \ | ||
--title "Update ${{ steps.get-filename.outputs.filename }}" \ | ||
--body "Automated update from plugin repository" \ | ||
--label "auto-merge") | ||
echo "Created PR: $pr_url" |
Binary file not shown.
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
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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
{ | ||
"timestamp": 1733329033716, | ||
"timestamp": 1733339206066, | ||
"version": "0.0.2", | ||
"fileHashes": { | ||
"index.js": "6ecd28c330e7b8a03930a7c8dccf7ed3557c1ffee1432eaf051132557deb974b", | ||
"info.json": "e7da105459df914a2dc0a5aca97353f30de077db392e3a239319be4defa6ac12", | ||
"LICENSE": "7f8f48e4266aa8fd3033dfaa4bb7f6e83a60c6e099f82d4959b81de90e67cd8f", | ||
"package-lock.json": "9575f7a9a8e17be37e8d9f256ca51030f805cba184290269b787f339d45c5854", | ||
"package.json": "51f04286fce1d186e444fe607083fd58be098e367361304fb976b3fee3bc49c1", | ||
"README.md": "e09a1b29d7ce2672131642e893083e4fd43c48aa450bd7ee677e2f2304ab2ad5" | ||
"info.json": "c587163c771877906e1fb83cad9875e5e99f41ccebb8c5366ac25374f51b490a" | ||
}, | ||
"signature": "W1DsMSX1OwISqv3ggJ8g51Rn5KfgrYhT1JhtZDU6ZNG8be4pV4Lkx3i3NpgghM6jRvSnIPg2h0Q/KTYQcIsr+RMXVYXdZmAcgYQMPcM0APWhf8G19Aml+bnT7PtoQVfitnZM9IGQilZU+/aNW2gkGSJrkn/Tr1q2+sSpasdf2FeXifn+334/6fGV50avxTbo1xxlnDyTt4BtawLBb0MfkB+sV6anVXAPgt3mX3S3GG1IKxii4i2f8mxsx9michzNa4s15TzQqFKpYQIrQyA/Xf9FhOjogM5AJkPkcVlqKU8hZoCUrPTJiKMuohquP2XPgk3kdHXKV0c/gdById7zig==" | ||
"signature": "MlYgOF8nMFLip2S0w1dB5k8a7bMZRslgM7MYzwvO2rs7ADoxxiwva/pQHwxuetPqMu1G4KswK1gOTS2lvr33e5KemQubQQXjdvjX/R9yIDPneAChy4FbEnzRm3OqWL1M0wj7dNCQNjCPonfM+K2C6dUWjvlvqUfLK2LkkLrSxtUByGEuaWoEGOqApYRQyT2MaA05eJ0+16AIInffr8J4rBlJ5gUdrcZxv50uhsqcOpXmxOSSe2eH85WWXnpITh+NMrx0aaiRBUpS+lcPV32igaXeQeCFu/ZWK8OSvTEb6ECcPHhCPwbF0XtQRBwt7d753aW7CkiBAhhlaYdk6xooTQ==" | ||
} |