Giter Site home page Giter Site logo

Comments (11)

dessant avatar dessant commented on May 27, 2024

but I would prefer that all issues and pull requests are closed/locked, but only on open ones a comment is left

I'm not sure I understand. Do you mean to lock issues and pull requests that have already been closed before the app was installed, but on issues that have been open, only leave a comment, without closing and locking?

from repo-lockdown.

dessant avatar dessant commented on May 27, 2024

Ok, now I've also read the issue title 😋 , and I think I understand what you want.

from repo-lockdown.

dessant avatar dessant commented on May 27, 2024

Actually I still have a hard time figuring out what's the exact behavior you need, please describe the feature in detail.

from repo-lockdown.

mitar avatar mitar commented on May 27, 2024

Sorry for confusion. I edited the description. To maybe repeat here, too. So some issues and PRs in my repo are open, and some of them are closed. Then I add this app, and currently it will go over all of them and close (if not already) and lock them and leave a comment. What I would like is that:

  • For closed issues and PRs, it just locks them.
  • For open issues and PRs, it closes/locks them, and leaves a comment.

from repo-lockdown.

dessant avatar dessant commented on May 27, 2024

Ok, now it's clear, thanks for following up! I see why you need the feature, but it is a bit arbitrary, and it would need several config options to configure which issues can be selectively locked or commented on depending on their state.

It may be better to use Lock Threads to lock your backlog of closed issues without leaving a comment, then remove the workflow file to disable the action.

For open issues and PRs you can then use Repo Lockdown and disable locking in the config.

from repo-lockdown.

dessant avatar dessant commented on May 27, 2024

Add this config file unchanged to .github/workflows/lock.yml, it will process 50 issues and PRs every hour. Make sure to remove the file when your backlog has been handled.

name: 'Lock threads'

on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  lock:
    runs-on: ubuntu-latest
    steps:
      - uses: dessant/lock-threads@v2
        with:
          github-token: ${{ github.token }}
          issue-lock-inactive-days: '0'
          issue-lock-reason: ''
          pr-lock-inactive-days: '0'
          pr-lock-reason: ''

from repo-lockdown.

mitar avatar mitar commented on May 27, 2024

Ok, now it's clear, thanks for following up! I see why you need the feature, but it is a bit arbitrary, and it would need several config options to configure which issues can be selectively locked or commented on depending on their state.

Hm, not sure how it is arbitrary. I think anyone who wants to migrate an active repository from GitHub to GitLab, while leaving the old one as read-only mirror will have this problem. Adding this app will go around all already closed issues and comment on them. A lot of noise. While telling people on open issues that repo got migrated and is now read-only is nice.

There is only one option needed, skipCommentOnClosed. So if issue or PR is closed when the bot gets around to it, don't make a comment.

I will look in more detail into a workaround you posted.

from repo-lockdown.

dessant avatar dessant commented on May 27, 2024

I was cautious about it because then people may want to skip locking open issues, and so on, for all option and state combinations. Though as you further described your use case, it makes a lot of sense, and it's probably best to add this single option. I plan to migrate this project to GitHub actions sometime soon and implement the feature there. I'll post a workflow file here when it's ready, thanks for the feature request!

from repo-lockdown.

mitar avatar mitar commented on May 27, 2024

Thanks!

from repo-lockdown.

dessant avatar dessant commented on May 27, 2024

Hi @mitar, the new GitHub action is alive! The README has all the details on how to add it for your repository, make sure to also remove the legacy app config and installation from the repository, otherwise it might interfere with the new action. Let me know if you need help with migrating.

https://github.com/dessant/repo-lockdown#reducing-notification-spam-while-commenting

from repo-lockdown.

mitar avatar mitar commented on May 27, 2024

Thanks! I will look into it.

from repo-lockdown.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.