From 629bf8b5fe5fbeedbd445af07dc1cb70c99fbd30 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Thu, 25 Apr 2024 10:48:39 +0530 Subject: [PATCH] chore: add workflow updates (#9) --- .editorconfig | 10 +++---- .github/release.yml | 42 ++++++++++++++++++++++++++++++ .github/workflows/auto-approve.yml | 19 +++----------- .github/workflows/main.yml | 30 ++++++++++----------- .github/workflows/pr-labeler.yml | 8 ++++++ .github/workflows/stale.yml | 31 ++++++---------------- 6 files changed, 81 insertions(+), 59 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/pr-labeler.yml diff --git a/.editorconfig b/.editorconfig index 3a501b0..da0310f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,13 +1,13 @@ +# editorconfig.org root = true [*] -indent_style = tab +indent_style = space +indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -max_line_length = 100 -[*.yml] -indent_style = space -indent_size = 2 \ No newline at end of file +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..d85e1ad --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,42 @@ +# .github/release.yml + +changelog: + exclude: + labels: + - documentation + - ignore-for-release + categories: + - title: Breaking Changes + labels: + - breaking + exclude: + labels: + - dependencies + - title: New Features + labels: + - enhancement + exclude: + labels: + - dependencies + - title: Bug Fixes + labels: + - bug + exclude: + labels: + - dependencies + - title: Security Patches + labels: + - security + - "security" + exclude: + labels: + - dependencies + - title: Dependencies + labels: + - dependencies + - title: Maintenance + labels: + - "*" + exclude: + labels: + - dependencies diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index ef20d2b..557bce6 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -1,20 +1,9 @@ name: Auto-approve PR on: pull_request_target permissions: - contents: write pull-requests: write jobs: - auto-approve-renovate-prs: - runs-on: ubuntu-latest - steps: - - name: Git Checkout - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - with: - fetch-depth: '0' - - name: Approve PR - if: github.actor == 'renovate[bot]' - run: | - gh pr review --approve ${{ github.event.number }} -b "I'm **approving** \ - this pull request because it includes a patch or minor update." - env: - GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file + apply: + if: github.actor == 'renovate[bot]' + uses: palashmon/reusable-workflows/.github/workflows/auto-approve.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67e15ed..45823ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,19 +1,17 @@ name: CI -on: [push, pull_request] + +on: + push: + branches: + - main + - master + pull_request: # PRs to main branches + workflow_dispatch: # manual trigger + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + jobs: test: - name: Node.js ${{ matrix.node-version }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - node-version: ['lts/*', 'current'] - steps: - - name: Checkout Repo - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - - name: Setup Node.js (${{ matrix.node-version }}) - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm test + uses: palashmon/reusable-workflows/.github/workflows/main-build.yml@main diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml new file mode 100644 index 0000000..f05f218 --- /dev/null +++ b/.github/workflows/pr-labeler.yml @@ -0,0 +1,8 @@ +name: PR labeler +on: + - pull_request_target +jobs: + apply: + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} # only PRs from this repo + uses: palashmon/reusable-workflows/.github/workflows/labeler-reusable.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d68a378..1d522a9 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,26 +1,11 @@ -# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. -# -# You can adjust the behavior by modifying this file. -# For more information, see: -# https://github.com/actions/stale -name: Mark stale issues and pull requests +name: 'Close stale issues and PRs' on: schedule: - - cron: "*/10 5 * * *" + - cron: '30 1 * * *' +permissions: + issues: write + pull-requests: write jobs: - stale: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 365 - stale-issue-message: "This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days." - stale-pr-message: "This PR is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days." - close-issue-message: "This issue was closed because it has been stalled for 7 days with no activity." - close-pr-message: "This PR was closed because it has been stalled for 7 days with no activity." - exempt-issue-labels: "Help Wanted, Good first issue, Never gets stale" - exempt-pr-labels: "Help Wanted, Never gets stale" + apply: + uses: palashmon/reusable-workflows/.github/workflows/stale.yml@main + secrets: inherit