NPM Package Retention #4
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
name: NPM Package Retention | |
on: | |
schedule: | |
- cron: "0 0 * * 0" # Run weekly on Sunday at midnight | |
jobs: | |
cleanup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Install npm | |
run: | | |
npm install -g npm@latest | |
- name: Configure npm | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Run retention script | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: python .github/scripts/npm_retention.py |