-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Automatically update site package (#48)
Releases: main
- Loading branch information
Showing
3 changed files
with
88 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,60 @@ | ||
name: Auto PR for Site Package Changes | ||
|
||
on: | ||
# Schedule to run daily at 2:00 AM UTC | ||
schedule: | ||
- cron: '0 2 * * *' | ||
|
||
# Manual trigger via "Run workflow" button in GitHub Actions UI | ||
workflow_dispatch: | ||
|
||
jobs: | ||
auto-pr: | ||
name: Create PR for Site Package Changes | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH_NAME: 'auto/sitepackage-update' | ||
COMMIT_MESSAGE: 'Auto-update of site package files' | ||
PR_TITLE: 'Automated Update of Site Package Files' | ||
PR_BODY: 'This PR contains automatic updates to the site package files generated by the script.' | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set Up Git | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Run Generate Site Package Script | ||
run: | | ||
chmod +x Build/DownloadSitePackage/generate_sitepackage.sh | ||
./Build/DownloadSitePackage/generate_sitepackage.sh | ||
- name: Check for Changes | ||
run: | | ||
if git diff --quiet; then | ||
echo "No changes detected, skipping PR creation." | ||
exit 0 | ||
fi | ||
- name: Create Branch | ||
run: | | ||
git checkout -b ${{ env.BRANCH_NAME }} | ||
git add . | ||
git commit -m "${{ env.COMMIT_MESSAGE }}" | ||
- name: Push Changes to New Branch | ||
run: | | ||
git push --force --set-upstream origin ${{ env.BRANCH_NAME }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ env.BRANCH_NAME }} | ||
title: ${{ env.PR_TITLE }} | ||
body: ${{ env.PR_BODY }} |
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,13 @@ | ||
{ | ||
"base_package": "site_package_tutorial", | ||
"typo3_version": 13.4, | ||
"title": "Site Package", | ||
"description": "This site package is an example used to understand the TYPO3 Site Package Tutorial. ", | ||
"repository_url": "https://github.com/TYPO3-Documentation/TYPO3CMS-Tutorial-SitePackage", | ||
"author": { | ||
"name": "TYPO3 Documentation Team", | ||
"email": "[email protected]", | ||
"company": "T3docs", | ||
"homepage": "https://docs.typo3.org/permalink/t3sitepackage:start" | ||
} | ||
} |
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,15 @@ | ||
#!/bin/bash | ||
|
||
curl -X 'POST' \ | ||
'https://get.typo3.org/api/v1/sitepackage/' \ | ||
-H 'accept: application/zip' \ | ||
-H 'Content-Type: application/json' \ | ||
-d @"$(dirname "$0")/data.json" --output my_site_package.zip | ||
|
||
rm -rf Classes | ||
rm -rf Configuration | ||
rm -rf ContentBlocks | ||
rm -rf Initialisation | ||
rm -rf Resources | ||
unzip -o my_site_package.zip | ||
rm my_site_package.zip |