mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Add UpdateTestRepos GitHub workflow for automatically refreshing test repository snapshots via pull request.
This commit is contained in:
parent
14b782f2d9
commit
401cb67f96
1 changed files with 41 additions and 0 deletions
41
.github/workflows/update-test-repos.yml
vendored
Normal file
41
.github/workflows/update-test-repos.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
name: UpdateTestRepos
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'dependabot/**'
|
||||
schedule:
|
||||
- cron: '30 12 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: next
|
||||
- uses: actions/setup-node@v4
|
||||
- run: git config user.email "david@dlaa.me"
|
||||
- run: git config user.name "David Anson"
|
||||
- run: git checkout -b update-test-repos-$GITHUB_RUN_ID
|
||||
- run: npm install
|
||||
- run: npm run update-test-repos
|
||||
env:
|
||||
AVA_FORCE_CI: not-ci
|
||||
- run: git diff --exit-code
|
||||
continue-on-error: true
|
||||
id: diff
|
||||
- run: git add .
|
||||
if: ${{ success() && steps.diff.outcome == 'failure' }}
|
||||
- run: git commit -m "Update test repository snapshots."
|
||||
if: ${{ success() && steps.diff.outcome == 'failure' }}
|
||||
- run: git push --set-upstream origin update-test-repos-$GITHUB_RUN_ID
|
||||
if: ${{ success() && steps.diff.outcome == 'failure' }}
|
||||
- run: gh pr create --base next --body "" --title "Update test repository snapshots."
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
if: ${{ success() && steps.diff.outcome == 'failure' }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue