forked from github/docs
-
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.
Merge branch 'main' into azure-subscriptions-issue-13018
- Loading branch information
Showing
1,158 changed files
with
661,277 additions
and
19,940 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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -6,28 +6,47 @@ name: Optimize images | |
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '45 17 * * 2' # Run Tuesdays at 17:45 UTC / 9:45 PST | ||
pull_request: | ||
paths: | ||
- '**/*.png' | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
optimize-images: | ||
if: github.repository == 'github/docs-internal' | ||
optimize-images-on-pr: | ||
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
- name: Check out repo on head ref | ||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Check out base ref | ||
run: git fetch --no-tags --depth=1 origin $GITHUB_BASE_REF | ||
|
||
- name: Install the Optipng package | ||
run: sudo apt-get update && sudo apt-get -y install optipng | ||
|
||
- name: Run the Optipng package | ||
run: find . -name '*.png' -print0 | xargs -0 optipng -nx | ||
- name: Run optipng on new or changed images | ||
run: | | ||
set -e # exit when any command fails | ||
echo "Ensure we can view $GITHUB_BASE_REF" | ||
git checkout $GITHUB_BASE_REF | ||
echo "Ensure we can view $GITHUB_HEAD_REF" | ||
git checkout $GITHUB_HEAD_REF | ||
- name: Make a branch, commit, push, and pull request | ||
echo "List the files that changed" | ||
git diff --name-only $GITHUB_HEAD_REF $GITHUB_BASE_REF | ||
echo "Run optipng on pngs in from the diff" | ||
git diff --name-only -z $GITHUB_HEAD_REF $GITHUB_BASE_REF -- '*.png' | xargs -0 optipng -nx | ||
- name: Make a commit and a push | ||
run: | | ||
echo "If there's no changes, exit" | ||
if [[ ! `git status --porcelain` ]] | ||
|
@@ -36,20 +55,13 @@ jobs: | |
exit 0 | ||
fi | ||
echo "Make a new branch" | ||
BRANCH="optimize-images-$(date +'%Y%m%d%H%M%S')" | ||
git checkout -b $BRANCH | ||
echo "Make a commit" | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add "*.png" | ||
git commit --message="Optimize images" | ||
echo "Push up changes" | ||
git push --set-upstream origin $BRANCH | ||
echo "Open a pull request" | ||
gh pr create --title "Optimize images" --body "Optimize images" --reviewer "@github/docs-engineering" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
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
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
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
Oops, something went wrong.