From d568eea1bae81fdc58c06188c053ae4d60701691 Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Thu, 2 Apr 2026 00:00:13 +0200 Subject: [PATCH 1/2] Update publish job --- .github/workflows/ci.yml | 38 +++++++++++++++----------------------- .gitignore | 1 + 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9e6430e..00500532 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,25 +1,17 @@ -name: CI on: push: - branches: - - main - pull_request: - branches: - - main + branches: [ main ] + jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: "16.x" - - run: npm ci - - run: npm test - publish: - if: github.ref == 'refs/heads/main' - needs: test + publish-pages: runs-on: ubuntu-latest + if: github.event.repository.fork == false + + # Required for the `deploy-pages` action + permissions: + pages: write + id-token: write + steps: - uses: actions/checkout@v2 with: @@ -29,9 +21,9 @@ jobs: node-version: "16.x" - run: npm ci - run: npm run build - - uses: peaceiris/actions-gh-pages@v3 + - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa #v3.0.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - keep_files: true - user_name: "github-actions[bot]" - user_email: "github-actions[bot]@users.noreply.github.com" + path: "public" + - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5 + + diff --git a/.gitignore b/.gitignore index 5ac98345..1deceb22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Logs +.idea logs *.log npm-debug.log* From abfe7eb2c1e3795c1bfa51eec1aa9a0cb09f0d43 Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Thu, 2 Apr 2026 00:02:08 +0200 Subject: [PATCH 2/2] Add pull_request workflow --- .github/workflows/build-pull-request.yaml | 15 ++++++ .../workflows/{ci.yml => publish-pages.yml} | 0 .github/workflows/wgutils-automerge.yml | 54 ------------------- 3 files changed, 15 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/build-pull-request.yaml rename .github/workflows/{ci.yml => publish-pages.yml} (100%) delete mode 100644 .github/workflows/wgutils-automerge.yml diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-pull-request.yaml new file mode 100644 index 00000000..82c1d5ba --- /dev/null +++ b/.github/workflows/build-pull-request.yaml @@ -0,0 +1,15 @@ +on: pull_request + +jobs: + build-pull-request: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-node@v1 + with: + node-version: "16.x" + - run: npm ci + - run: npm test diff --git a/.github/workflows/ci.yml b/.github/workflows/publish-pages.yml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/publish-pages.yml diff --git a/.github/workflows/wgutils-automerge.yml b/.github/workflows/wgutils-automerge.yml deleted file mode 100644 index d82b0d3a..00000000 --- a/.github/workflows/wgutils-automerge.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Agenda auto-merge - -on: - pull_request_target: - types: [synchronize, opened, reopened] - -permissions: - contents: write - pull-requests: read - checks: read - -jobs: - validate-and-merge: - if: ${{ github.event.pull_request.base.ref == 'main' }} - runs-on: ubuntu-latest - - steps: - # SECURITY: it's critical we do not check out the source pull request! - - name: Checkout the main branch - uses: actions/checkout@v3 - with: - ref: main - - # We need wgutils to be installed - - run: yarn install - - - name: Wait for checks to pass - env: - GH_TOKEN: ${{ github.token }} - run: | - # Give 15 seconds for any checks to register - sleep 15 - - # Wait for checks to pass - gh pr checks ${{ github.event.pull_request.number }} --fail-fast --watch --required 2>&1 || true - # Now get the result in JSON - CHECKS_OUTPUT="$(gh pr checks ${{ github.event.pull_request.number }} --required --json bucket --jq 'map(.bucket == "pass") | all' 2>&1 || true)" - - if echo "$CHECKS_OUTPUT" | grep -q "no required checks reported"; then - echo "Not required: $CHECKS_OUTPUT" - elif [[ "$CHECKS_OUTPUT" == "true" ]]; then - echo "$CHECKS_OUTPUT" - else - echo "PR state failed? $CHECKS_OUTPUT" - exit 1 - fi - - - name: Automerge if wgutils approves - env: - GH_TOKEN: ${{ github.token }} - run: | - if yarn wgutils can-automerge "${{ github.event.pull_request.number }}" "${{ github.event.pull_request.head.sha }}"; then - gh pr merge "${{ github.event.pull_request.number }}" --squash --auto --match-head-commit "${{ github.event.pull_request.head.sha }}" - fi