forked from shaka-project/shaka-player
-
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
872d5fb
commit 655f5c6
Showing
1 changed file
with
15 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -93,6 +93,17 @@ jobs: | |
|
||
- name: Update screenshots | ||
run: | | ||
# NPM packages and the image update scripts could all be modified by | ||
# an attacker to inject code into this step of the workflow. Use | ||
# copies of those files from the main branch as a safeguard. Up to | ||
# now, nothing controlled by the PR author has been executed. | ||
git checkout main -- \ | ||
package-lock.json \ | ||
package.json \ | ||
build/shakaBuildHelpers.py \ | ||
build/updateScreenshots.py \ | ||
build/imageSimilarity.js | ||
# Install prerequisites. | ||
npm ci | ||
|
@@ -104,7 +115,8 @@ jobs: | |
git config user.name "shaka-bot" | ||
git config user.email "[email protected]" | ||
# Commit the changes. Ignore failure, in case there are no changes. | ||
# Commit the changes to the screenshots only. Ignore failure, in | ||
# case there are no changes. | ||
git add test/test/assets/screenshots/*/*.png || true | ||
git commit -m ':robot: Update all screenshots' || true | ||
|
@@ -113,6 +125,8 @@ jobs: | |
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
# Update the PR. | ||
# Compute the destination for the push. | ||
PR_API_URL="/repos/${{ github.repository }}/pulls/${{ inputs.pr }}" | ||
REMOTE=$(gh api $PR_API_URL | jq -r .head.repo.html_url) | ||
BRANCH=$(gh api $PR_API_URL | jq -r .head.ref) | ||
|