* Bump actions/checkout from 2.3.4 to 2.3.5
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](5a4ac9002d...1e204e9a92)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
* test
* removing test, works
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Grace Park <gracepark@github.com>
68 lines
2.4 KiB
YAML
68 lines
2.4 KiB
YAML
name: Remove unused assets
|
|
|
|
# **What it does**:
|
|
# **Why we have it**:
|
|
# **Who does it impact**:
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '20 15 * * 0' # run every Sunday at 20:15 UTC / 12:15 PST
|
|
|
|
env:
|
|
FREEZE: ${{ secrets.FREEZE }}
|
|
|
|
jobs:
|
|
remove_unused_assets:
|
|
name: Remove unused assets
|
|
if: github.repository == 'github/docs-internal'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- if: ${{ env.FREEZE == 'true' }}
|
|
run: |
|
|
echo 'The repo is currently frozen! Exiting this workflow.'
|
|
exit 1 # prevents further steps from running
|
|
- name: Checkout
|
|
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
|
|
- name: Setup Node
|
|
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
|
|
with:
|
|
node-version: 16.8.x
|
|
cache: npm
|
|
- name: npm ci
|
|
run: npm ci
|
|
- name: Run scripts
|
|
run: |
|
|
script/remove-unused-assets.js > results.md
|
|
script/remove-extraneous-translation-files.js
|
|
- name: Get script results to use in PR body
|
|
id: results
|
|
uses: juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512
|
|
with:
|
|
path: ./results.md
|
|
- name: Remove script results file
|
|
run: rm -rf ./results.md
|
|
- name: Create pull request
|
|
uses: peter-evans/create-pull-request@7380612b49221684fefa025244f2ef4008ae50ad
|
|
env:
|
|
# Disable pre-commit hooks; they don't play nicely here
|
|
HUSKY: '0'
|
|
with:
|
|
# need to use a token with repo and workflow scopes for this step
|
|
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
|
|
commit-message: Action ran script/remove-unused-assets.js
|
|
title: Remove unused assets
|
|
body:
|
|
"Hello! This PR removes some files that exist in the repo but are not used in content or data files:\n\n
|
|
${{ steps.results.outputs.content }}
|
|
\n\nIf you have any questions, please contact @github/docs-engineering."
|
|
labels: unused assets
|
|
project: Core docs work for the current week
|
|
project-column: Should do
|
|
branch: remove-unused-assets
|
|
- if: ${{ failure() }}
|
|
name: Delete remote branch (if previous steps failed)
|
|
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branches: remove-unused-assets
|