-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI jobs to reformat Blueprints and confirm a Blueprint is even sh…
…ipped in a PR verify
- Loading branch information
Showing
5 changed files
with
81 additions
and
51 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,48 @@ | ||
name: Post-process Blueprints after changes | ||
|
||
on: | ||
push: | ||
branches: | ||
- trunk | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install Prettier | ||
run: npm install -g prettier | ||
- name: Run make_index.py | ||
run: python make_index.py | ||
- name: Run Prettier | ||
run: prettier --write blueprints/**/*.json | ||
- name: Check for uncommitted changes | ||
id: changes | ||
run: | | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "No changes" | ||
echo 'CHANGES=0' >> $GITHUB_OUTPUT | ||
else | ||
echo "Changes detected" | ||
echo 'CHANGES=1' >> $GITHUB_OUTPUT | ||
fi | ||
- name: Setup SSH Keys | ||
uses: webfactory/ssh-agent@v0.5.3 | ||
with: | ||
ssh-private-key: ${{ secrets.GH_DEPLOY_KEY }} | ||
- name: Push rebuilt WordPress to GitHub | ||
if: steps.changes.outputs.CHANGES == '1' | ||
run: | | ||
git config --global user.name "deployment_bot" | ||
git config --global user.email "deployment_bot@users.noreply.github.com" | ||
git add -A | ||
git commit -a -m "Reindex Blueprints" | ||
git pull --rebase | ||
if [ $? -eq 0 ]; then | ||
git push git@github.com:${{ github.repository }}.git --follow-tags | ||
fi; |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
name: Ships Blueprint.json file? | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check_blueprints: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Find updated directories | ||
id: find_directories | ||
run: | | ||
git diff --name-only origin/main...$GITHUB_SHA | grep '^blueprints/' | cut -d/ -f2 | sort -u > updated_directories.txt | ||
- name: Check blueprint.json files | ||
id: check_blueprints | ||
run: | | ||
while IFS= read -r directory; do | ||
if [ ! -f "blueprints/$directory/blueprint.json" ]; then | ||
echo "Missing blueprint.json file in $directory" | ||
exit 1 | ||
fi | ||
done < updated_directories.txt |
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,4 @@ | ||
{ | ||
"tabWidth": 4, | ||
"useTabs": true | ||
} |
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