From 53151997ca231a63ef2fff363717c66ec543341d Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Tue, 7 Jan 2025 17:39:35 +0530 Subject: [PATCH] ci: add labels sync, release and stale workflows --- .github/labels.json | 170 ---------------------------------- .github/lock.yml | 23 ----- .github/stale.yml | 21 ----- .github/workflows/checks.yml | 1 + .github/workflows/labels.yml | 15 +++ .github/workflows/release.yml | 32 +++++++ .github/workflows/stale.yml | 17 ++++ 7 files changed, 65 insertions(+), 214 deletions(-) delete mode 100644 .github/labels.json delete mode 100644 .github/lock.yml delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/labels.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/labels.json b/.github/labels.json deleted file mode 100644 index ba001c6..0000000 --- a/.github/labels.json +++ /dev/null @@ -1,170 +0,0 @@ -[ - { - "name": "Priority: Critical", - "color": "ea0056", - "description": "The issue needs urgent attention", - "aliases": [] - }, - { - "name": "Priority: High", - "color": "5666ed", - "description": "Look into this issue before picking up any new work", - "aliases": [] - }, - { - "name": "Priority: Medium", - "color": "f4ff61", - "description": "Try to fix the issue for the next patch/minor release", - "aliases": [] - }, - { - "name": "Priority: Low", - "color": "87dfd6", - "description": "Something worth considering, but not a top priority for the team", - "aliases": [] - }, - { - "name": "Semver: Alpha", - "color": "008480", - "description": "Will make it's way to the next alpha version of the package", - "aliases": [] - }, - { - "name": "Semver: Major", - "color": "ea0056", - "description": "Has breaking changes", - "aliases": [] - }, - { - "name": "Semver: Minor", - "color": "fbe555", - "description": "Mainly new features and improvements", - "aliases": [] - }, - { - "name": "Semver: Next", - "color": "5666ed", - "description": "Will make it's way to the bleeding edge version of the package", - "aliases": [] - }, - { - "name": "Semver: Patch", - "color": "87dfd6", - "description": "A bug fix", - "aliases": [] - }, - { - "name": "Status: Abandoned", - "color": "ffffff", - "description": "Dropped and not into consideration", - "aliases": ["wontfix"] - }, - { - "name": "Status: Accepted", - "color": "e5fbf2", - "description": "The proposal or the feature has been accepted for the future versions", - "aliases": [] - }, - { - "name": "Status: Blocked", - "color": "ea0056", - "description": "The work on the issue or the PR is blocked. Check comments for reasoning", - "aliases": [] - }, - { - "name": "Status: Completed", - "color": "008672", - "description": "The work has been completed, but not released yet", - "aliases": [] - }, - { - "name": "Status: In Progress", - "color": "73dbc4", - "description": "Still banging the keyboard", - "aliases": ["in progress"] - }, - { - "name": "Status: On Hold", - "color": "f4ff61", - "description": "The work was started earlier, but is on hold now. Check comments for reasoning", - "aliases": ["On Hold"] - }, - { - "name": "Status: Review Needed", - "color": "fbe555", - "description": "Review from the core team is required before moving forward", - "aliases": [] - }, - { - "name": "Status: Awaiting More Information", - "color": "89f8ce", - "description": "Waiting on the issue reporter or PR author to provide more information", - "aliases": [] - }, - { - "name": "Status: Need Contributors", - "color": "7057ff", - "description": "Looking for contributors to help us move forward with this issue or PR", - "aliases": [] - }, - { - "name": "Type: Bug", - "color": "ea0056", - "description": "The issue has indentified a bug", - "aliases": ["bug"] - }, - { - "name": "Type: Security", - "color": "ea0056", - "description": "Spotted security vulnerability and is a top priority for the core team", - "aliases": [] - }, - { - "name": "Type: Duplicate", - "color": "00837e", - "description": "Already answered or fixed previously", - "aliases": ["duplicate"] - }, - { - "name": "Type: Enhancement", - "color": "89f8ce", - "description": "Improving an existing feature", - "aliases": ["enhancement"] - }, - { - "name": "Type: Feature Request", - "color": "483add", - "description": "Request to add a new feature to the package", - "aliases": [] - }, - { - "name": "Type: Invalid", - "color": "dbdbdb", - "description": "Doesn't really belong here. Maybe use discussion threads?", - "aliases": ["invalid"] - }, - { - "name": "Type: Question", - "color": "eceafc", - "description": "Needs clarification", - "aliases": ["help wanted", "question"] - }, - { - "name": "Type: Documentation Change", - "color": "7057ff", - "description": "Documentation needs some improvements", - "aliases": ["documentation"] - }, - { - "name": "Type: Dependencies Update", - "color": "00837e", - "description": "Bump dependencies", - "aliases": ["dependencies"] - }, - { - "name": "Good First Issue", - "color": "008480", - "description": "Want to contribute? Just filter by this label", - "aliases": ["good first issue"] - } -] diff --git a/.github/lock.yml b/.github/lock.yml deleted file mode 100644 index 2ad97a0..0000000 --- a/.github/lock.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app - -# Number of days of inactivity before a closed issue or pull request is locked -daysUntilLock: 60 - -# Skip issues and pull requests created before a given timestamp. Timestamp must -# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable -skipCreatedBefore: false - -# Issues and pull requests with these labels will be ignored. Set to `[]` to disable -exemptLabels: ['Type: Security'] - -# Label to add before locking, such as `outdated`. Set to `false` to disable -lockLabel: false - -# Comment to post before locking. Set to `false` to disable -lockComment: > - This thread has been automatically locked since there has not been - any recent activity after it was closed. Please open a new issue for - related bugs. - -# Assign `resolved` as the reason for locking. Set to `false` to disable -setLockReason: false diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index f767674..0000000 --- a/.github/stale.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 - -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 - -# Issues with these labels will never be considered stale -exemptLabels: - - 'Type: Security' - -# Label to use when marking an issue as stale -staleLabel: 'Status: Abandoned' - -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. - -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7daa494..8d1eabc 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,6 +2,7 @@ name: checks on: - push - pull_request + - workflow_call jobs: test: diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..af9b6f0 --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,15 @@ +name: Sync labels +on: + workflow_dispatch: +permissions: + issues: write +jobs: + labels: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: EndBug/label-sync@v2 + with: + config-file: 'https://raw.githubusercontent.com/thetutlage/static/main/labels.yml' + delete-other-labels: true + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fde89b4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: release +on: workflow_dispatch +permissions: + contents: write + id-token: write +jobs: + checks: + uses: ./.github/workflows/checks.yml + release: + needs: checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - name: git config + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + - name: Init npm config + run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: npm install + - run: npm run release -- --ci + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..cad5c91 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,17 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 0 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + stale-issue-message: 'This issue has been marked as stale because it has been inactive for more than 21 days. Please reopen if you still need help on this issue' + stale-pr-message: 'This pull request has been marked as stale because it has been inactive for more than 21 days. Please reopen if you still intend to submit this pull request' + close-issue-message: 'This issue has been automatically closed because it has been inactive for more than 4 weeks. Please reopen if you still need help on this issue' + close-pr-message: 'This pull request has been automatically closed because it has been inactive for more than 4 weeks. Please reopen if you still intend to submit this pull request' + days-before-stale: 21 + days-before-close: 5