From a748ffeb7e81808b613b7c6c56787b0f67815ded Mon Sep 17 00:00:00 2001 From: blu3 Date: Sun, 13 Jul 2025 17:36:53 +0300 Subject: [PATCH] Setup Dependabot and update actions (#1121) * Update build action * Update comment action * Update website linter * Setup Dependabot --- .github/dependabot.yml | 14 +++++++ .github/workflows/build.yaml | 23 +++++------ .github/workflows/commentCommands.yml | 53 ------------------------- .github/workflows/commentcommands.yml | 57 +++++++++++++++++++++++++++ .github/workflows/weblint.yml | 20 ++++++---- 5 files changed, 96 insertions(+), 71 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/commentCommands.yml create mode 100644 .github/workflows/commentcommands.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..60783b1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "npm" + directory: "/Website" + schedule: + interval: "daily" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index adb3fd1..1ec69ed 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,29 +2,30 @@ name: Test Build Extension on: push: - branches: [main] + branches: + - main paths: - Extensions/combined/** - pull_request: - branches: [main] + branches: + - main paths: - Extensions/combined/** jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 defaults: run: working-directory: ./Extensions/combined steps: - - name: Checkout - uses: actions/checkout@main + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup Node 20 - uses: actions/setup-node@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: '20.x' @@ -34,19 +35,19 @@ jobs: - name: Build extension run: npm run build - - name: 'Upload Chrome artifact' + - name: Upload Chrome artifact uses: actions/upload-artifact@v4 with: name: ryd-chrome path: ./Extensions/combined/dist/chrome - - name: 'Upload Firefox artifact' + - name: Upload Firefox artifact uses: actions/upload-artifact@v4 with: name: ryd-firefox path: ./Extensions/combined/dist/firefox - - name: 'Upload Safari artifact' + - name: Upload Safari artifact uses: actions/upload-artifact@v4 with: name: ryd-safari diff --git a/.github/workflows/commentCommands.yml b/.github/workflows/commentCommands.yml deleted file mode 100644 index 1d9b47c..0000000 --- a/.github/workflows/commentCommands.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: commentCommands - -on: - issue_comment: - types: created - -jobs: - assign-commenter: - runs-on: ubuntu-latest - if: | - contains(github.event.comment.body, '/assignme') || - contains(github.event.comment.body, '/assign me') - steps: - - name: Assigning to commenter - run: | - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees \ - -d '{"assignees":["${{ github.event.comment.user.login }}"]}' - request-issue-framing-improvement: - runs-on: ubuntu-latest - if: | - contains(github.event.comment.body,'/improve') && ( - github.event.comment.author_association == 'OWNER' || - github.event.comment.author_association == 'COLLABORATOR' || - github.event.comment.author_association == 'CONTRIBUTOR' ) - steps: - - name: request-issue-framing-improvement - run: | - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \ - -d '{"body":"This issue is put on hold due to low quality. No reviews or fixes will be performed at this time. Eventually, it will be closed. While we appreciate your effort writing, we are not able to further investigate it. Please improve it by writing a better title or providing more details, and you may re-open it."}' - add-label-duplicate: - runs-on: ubuntu-latest - if: | - contains(github.event.comment.body, '/duplicate') && ( - github.event.comment.author_association == 'OWNER' || - github.event.comment.author_association == 'COLLABORATOR' || - github.event.comment.author_association != 'CONTRIBUTOR' ) - steps: - - name: add-label-duplicate - run: | - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels \ - -d '{"labels":["duplicate"]}' diff --git a/.github/workflows/commentcommands.yml b/.github/workflows/commentcommands.yml new file mode 100644 index 0000000..8ac13d2 --- /dev/null +++ b/.github/workflows/commentcommands.yml @@ -0,0 +1,57 @@ +name: Comment Commands + +on: + issue_comment: + types: [created] + +jobs: + assign-commenter: + runs-on: ubuntu-24.04 + if: | + contains(github.event.comment.body, '/assignme') || + contains(github.event.comment.body, '/assign me') + steps: + - name: Assigning commenter + run: | + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees \ + -d '{"assignees":["${{ github.event.comment.user.login }}"]}' + + request-issue-framing-improvement: + runs-on: ubuntu-24.04 + if: | + contains(github.event.comment.body, '/improve') && ( + github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'COLLABORATOR' || + github.event.comment.author_association == 'CONTRIBUTOR' + ) + steps: + - name: Request issue framing improvement + run: | + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \ + -d '{"body":"This issue is put on hold due to low quality. No reviews or fixes will be performed at this time. Eventually, it will be closed. While we appreciate your effort writing, we are not able to further investigate it. Please improve it by writing a better title or providing more details, and you may re-open it."}' + + add-duplicate-label: + runs-on: ubuntu-24.04 + if: | + contains(github.event.comment.body, '/duplicate') && ( + github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'COLLABORATOR' || + github.event.comment.author_association != 'CONTRIBUTOR' + ) + steps: + - name: Add duplicate label + run: | + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels \ + -d '{"labels":["duplicate"]}' diff --git a/.github/workflows/weblint.yml b/.github/workflows/weblint.yml index 3ca18a3..70e4521 100644 --- a/.github/workflows/weblint.yml +++ b/.github/workflows/weblint.yml @@ -4,22 +4,28 @@ name: Website Lint on: push: - branches: [main] + branches: + - main paths: - Website/** - pull_request: - branches: [main] + branches: + - main paths: - Website/** jobs: weblint: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@main - - run: npm install + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: npm install working-directory: Website - - run: npm run lint + + - name: Run lint + run: npm run lint working-directory: Website