Definitions #1411
This file contains hidden or 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: Definitions | |
| on: | |
| schedule: [{ cron: "0 */6 * * *" }] # 6hrly https://crontab.guru/#0_*/6_*_*_* | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| scrape: | |
| runs-on: ubuntu-latest | |
| permissions: { contents: write } | |
| steps: | |
| - uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: { egress-policy: audit } | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: true # need creds for subsequent git ops | |
| - run: npm ci | |
| - run: git checkout -b "scrape/definitions" | |
| - run: npm run scrape-definitions | |
| - run: npm run commit-definitions | |
| env: | |
| GIT_AUTHOR_NAME: ${{ vars.NODENV_BOT_NAME }} | |
| GIT_AUTHOR_EMAIL: ${{ vars.NODENV_BOT_EMAIL }} | |
| GIT_COMMITTER_NAME: ${{ vars.GHA_BOT_NAME }} | |
| GIT_COMMITTER_EMAIL: ${{ vars.GHA_BOT_EMAIL }} | |
| - name: gh pr create | |
| run: | | |
| git push -fu origin HEAD | |
| gh pr create --fill -t "Scraped definitions" | |
| gh pr merge --auto --merge | |
| env: | |
| GH_TOKEN: ${{ secrets.BOT_TOKEN }} |