From bde2c458a3a7d68dacc2b6cfd6a2c3f0cf49db3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 10:47:07 +0000 Subject: [PATCH 1/3] Initial plan From c3e152fa8b43e78b46c182e3a71007126fbb2e93 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 10:50:50 +0000 Subject: [PATCH 2/3] Add GitHub workflows for PR builds and releases, update manifest version to IN-DEV Co-authored-by: scolastico <26954501+scolastico@users.noreply.github.com> --- .github/workflows/pr-build.yml | 69 +++++++++++++++++++++++++++++ .github/workflows/release-build.yml | 49 ++++++++++++++++++++ src/manifest.json | 2 +- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr-build.yml create mode 100644 .github/workflows/release-build.yml diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 0000000..2195bf1 --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,69 @@ +name: Build and Comment on PR + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build-and-comment: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get version from manifest + id: get_version + run: | + VERSION=$(jq -r '.version' src/manifest.json) + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Create addon archive + run: | + cd src + VERSION="${{ steps.get_version.outputs.version }}" + zip -r ../dom-time-machine-v${VERSION}.zip . + cd .. + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: dom-time-machine-v${{ steps.get_version.outputs.version }} + path: dom-time-machine-v${{ steps.get_version.outputs.version }}.zip + retention-days: 30 + + - name: Comment on PR + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + const version = '${{ steps.get_version.outputs.version }}'; + const runId = context.runId; + const repo = context.repo; + + const comment = `## 🎉 Addon Build Complete + + The addon has been successfully built for this PR! + + **Version:** \`${version}\` + **Build:** [#${runId}](https://github.com/${repo.owner}/${repo.repo}/actions/runs/${runId}) + + You can download the built addon from the artifacts section of the workflow run. + + ### Installation Instructions + 1. Download the artifact from the [workflow run](https://github.com/${repo.owner}/${repo.repo}/actions/runs/${runId}) + 2. Extract the zip file + 3. Load the extension in your browser: + - **Firefox:** Navigate to \`about:debugging#/runtime/this-firefox\`, click "Load Temporary Add-on", and select the manifest.json + - **Chrome:** Navigate to \`chrome://extensions\`, enable "Developer mode", click "Load unpacked", and select the extracted folder + `; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }); diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 0000000..663937e --- /dev/null +++ b/.github/workflows/release-build.yml @@ -0,0 +1,49 @@ +name: Build and Attach to Release + +on: + release: + types: [created] + +jobs: + build-and-attach: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get release tag + id: get_tag + run: | + TAG=${GITHUB_REF#refs/tags/} + # Remove 'v' prefix if present + VERSION=${TAG#v} + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "tag=$TAG" >> $GITHUB_OUTPUT + + - name: Update manifest version + run: | + jq --arg version "${{ steps.get_tag.outputs.version }}" \ + '.version = $version' src/manifest.json > src/manifest.json.tmp + mv src/manifest.json.tmp src/manifest.json + + - name: Create addon archive + run: | + cd src + VERSION="${{ steps.get_tag.outputs.version }}" + zip -r ../dom-time-machine-v${VERSION}.zip . + cd .. + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: >- + ./dom-time-machine-v${{ steps.get_tag.outputs.version }}.zip + asset_name: >- + dom-time-machine-v${{ steps.get_tag.outputs.version }}.zip + asset_content_type: application/zip diff --git a/src/manifest.json b/src/manifest.json index a78b442..1879dee 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "DOM Time Machine Pro", - "version": "2.1", + "version": "IN-DEV", "permissions": [ "storage", "unlimitedStorage", From d4c3be51530edae45ddbdb887dbdd59a5cd345bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 10:52:44 +0000 Subject: [PATCH 3/3] Fix code review issues: remove unused fs import, replace deprecated action, prevent duplicate comments Co-authored-by: scolastico <26954501+scolastico@users.noreply.github.com> --- .github/workflows/pr-build.yml | 21 ++++++++++++++++++++- .github/workflows/release-build.yml | 11 ++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 2195bf1..d449aaa 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -39,11 +39,30 @@ jobs: uses: actions/github-script@v7 with: script: | - const fs = require('fs'); const version = '${{ steps.get_version.outputs.version }}'; const runId = context.runId; const repo = context.repo; + // Find and delete previous bot comments + const comments = await github.rest.issues.listComments({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + }); + + const botComments = comments.data.filter(comment => + comment.user.type === 'Bot' && + comment.body.includes('🎉 Addon Build Complete') + ); + + for (const comment of botComments) { + await github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: comment.id, + }); + } + const comment = `## 🎉 Addon Build Complete The addon has been successfully built for this PR! diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 663937e..dd7d52c 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -37,13 +37,6 @@ jobs: cd .. - name: Upload release asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: >- - ./dom-time-machine-v${{ steps.get_tag.outputs.version }}.zip - asset_name: >- - dom-time-machine-v${{ steps.get_tag.outputs.version }}.zip - asset_content_type: application/zip + files: dom-time-machine-v${{ steps.get_tag.outputs.version }}.zip