From 95490d43954c9b4604df4f12d7bf65cacdafcfa2 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Thu, 25 Apr 2024 10:24:54 +0530 Subject: [PATCH] chore: add workflow updates --- .editorconfig | 9 ++++--- .github/release.yml | 42 ++++++++++++++++++++++++++++++ .github/workflows/auto-approve.yml | 6 +++-- .github/workflows/main.yml | 4 +-- .github/workflows/pr-labeler.yml | 8 ++++++ .github/workflows/stale.yml | 31 ++++++---------------- 6 files changed, 68 insertions(+), 32 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/pr-labeler.yml diff --git a/.editorconfig b/.editorconfig index 1c6314a..5d12634 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +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 -[*.yml] -indent_style = space -indent_size = 2 +[*.md] +trim_trailing_whitespace = false 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 41b26da..557bce6 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -3,5 +3,7 @@ on: pull_request_target permissions: pull-requests: write jobs: - auto-approve: - uses: palashmon/reusable-workflows/.github/workflows/auto-approve.yml@main \ 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 dce2306..62820c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,11 +5,9 @@ on: branches: - main - master - pull_request: # PRs to main and master branches + pull_request: # PRs to main branches workflow_dispatch: # manual trigger -# Control the concurrency of workflow runs -# so that you can ensure that only one workflow runs at a time in a specific context. concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: true 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 c3fe721..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