Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'main' into dependabot/npm_and_yarn/nock-13.3.0
  • Loading branch information
James M. Greene authored and GitHub committed Feb 14, 2023
2 parents 8199da9 + dfb0b02 commit da1c9ce
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/check-dist.yml
Expand Up @@ -42,9 +42,3 @@ jobs:
git diff
exit 1
fi
if [ "$(git diff --ignore-space-at-eol pre/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build in pre folder. See status below:"
git diff
exit 1
fi
46 changes: 46 additions & 0 deletions .github/workflows/rebuild-dependabot-prs.yml
@@ -0,0 +1,46 @@
name: Rebuild distributables for Dependabot PRs

on:
push:
branches:
- 'dependabot/npm**'

permissions:
contents: write

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
rebuild-dist:
if: ${{ github.event.sender.login == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Rebuild the dist/ directory
run: npm run prepare

- name: Commit any differences present in the dist/ directory
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after rebuild in dist folder. Committing..."
git add dist/
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Update distributables after Dependabot 🤖"
echo "Pushing branch ${{ github.ref_name }}"
git push origin ${{ github.ref_name }}
fi

0 comments on commit da1c9ce

Please sign in to comment.