From 5acfbbfe53c73cb1e446798ecfa22f55e57efbee Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 10 Feb 2023 22:56:02 -0600 Subject: [PATCH 1/5] Remove check for `pre/` distributables --- .github/workflows/check-dist.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 6d5ff20..b7d1c1e 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -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 From 51ec3f54b3ff8e4dd05c707234ac3dfc9dc740fc Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 10 Feb 2023 23:03:00 -0600 Subject: [PATCH 2/5] Add a workflow to rebuild the distributables for Dependabot PRs --- .github/workflows/rebuild-dependabot-prs.yml | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/rebuild-dependabot-prs.yml diff --git a/.github/workflows/rebuild-dependabot-prs.yml b/.github/workflows/rebuild-dependabot-prs.yml new file mode 100644 index 0000000..9051464 --- /dev/null +++ b/.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 From 423b8fadd32b414991e4e25405c74b700f118aea Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 10 Feb 2023 23:08:32 -0600 Subject: [PATCH 3/5] Fix wacky indentation from GitHub UI editor --- .github/workflows/rebuild-dependabot-prs.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rebuild-dependabot-prs.yml b/.github/workflows/rebuild-dependabot-prs.yml index 9051464..d8151f0 100644 --- a/.github/workflows/rebuild-dependabot-prs.yml +++ b/.github/workflows/rebuild-dependabot-prs.yml @@ -2,8 +2,8 @@ name: Rebuild distributables for Dependabot PRs on: push: - branches: - - 'dependabot/npm**' + branches: + - 'dependabot/npm**' permissions: contents: write @@ -37,10 +37,10 @@ jobs: 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 + 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 From 953889442ffc2885eaef19d3632fea418b18d1e7 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 10 Feb 2023 23:09:20 -0600 Subject: [PATCH 4/5] Spacing again!? --- .github/workflows/rebuild-dependabot-prs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rebuild-dependabot-prs.yml b/.github/workflows/rebuild-dependabot-prs.yml index d8151f0..8a99679 100644 --- a/.github/workflows/rebuild-dependabot-prs.yml +++ b/.github/workflows/rebuild-dependabot-prs.yml @@ -37,7 +37,7 @@ jobs: 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 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 🤖" From ec96bc50175dc6c4daef69365411ee79e9557ff5 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 10 Feb 2023 23:11:30 -0600 Subject: [PATCH 5/5] Just run Prettier to fix indentation nonsense --- .github/workflows/rebuild-dependabot-prs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rebuild-dependabot-prs.yml b/.github/workflows/rebuild-dependabot-prs.yml index 8a99679..b3ec72b 100644 --- a/.github/workflows/rebuild-dependabot-prs.yml +++ b/.github/workflows/rebuild-dependabot-prs.yml @@ -3,7 +3,7 @@ name: Rebuild distributables for Dependabot PRs on: push: branches: - - 'dependabot/npm**' + - 'dependabot/npm**' permissions: contents: write