Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial setup #1

Merged
merged 11 commits into from
Aug 20, 2024
Merged

Initial setup #1

merged 11 commits into from
Aug 20, 2024

Conversation

paescuj
Copy link
Member

@paescuj paescuj commented Aug 1, 2024

Simple GitHub action for closing issues certain days after they have been marked with a stale label.

This addresses directus/directus#22959. A separate action is required as the currently used one (https://github.com/actions/stale) does not fulfill our needs, see actions/stale#1135 (comment).
In contrast, this action simply uses the labeling date to determine when to close an issue.

The action will be usable as follows:

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: directus/stale-issues-action@vX
        with:
          stale-label: stale
          days-before-close: 7
          close-message: Closing this issue as it has become stale.

  • The action can be tested locally as follows:
    pnpm build
    env 'INPUT_GITHUB-TOKEN=<my-token>' 'INPUT_GITHUB-REPO=directus/directus' 'INPUT_STALE-LABEL=:detective: Needs More Info' 'INPUT_DAYS-BEFORE-CLOSE=7' 'INPUT_DRY-RUN=true' node dist/index.js
    
    Found 5 issues with stale label
    Issue #22265 (https://github.com/directus/directus/issues/22265) is stale since 3 months and would have been closed (dry-run)
    Issue #22284 (https://github.com/directus/directus/issues/22284) is stale since 3 months and would have been closed (dry-run)
    Issue #22488 (https://github.com/directus/directus/issues/22488) is stale since 2 months and would have been closed (dry-run)
    Issue #22527 (https://github.com/directus/directus/issues/22527) is stale since 2 months and would have been closed (dry-run)
    Issue #23105 (https://github.com/directus/directus/issues/23105) is not yet stale, will become stale in 2 hours
    
    ::set-output name=closed-issues::[22265,22284,22488,22527]
    
  • Included workflows:
    • Rebuild: Builds the action on every commit to main, updating the dist if there are any changes
    • Check: Lint, Typecheck, Test (dry-run action call)
    • Release: Create new version by dispatching this workflow
  • Unit test have been added

@paescuj paescuj force-pushed the init branch 3 times, most recently from 5cdb493 to db97bdb Compare August 2, 2024 13:02
Copy link
Member

@wrynegade wrynegade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good setup overall!

I've put some general review throughout the GitHub Actions workflows, but the big thing that's missing here are our unit tests *.test.ts. Especially since the logic is so easy right now, we absolutely need to make sure we've got those in place :)

license Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
action.yml Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
src/lib/close-issue.ts Outdated Show resolved Hide resolved
.github/workflows/autofix.yml Outdated Show resolved Hide resolved
.github/workflows/check.yml Outdated Show resolved Hide resolved
.github/actions/setup-env/action.yml Outdated Show resolved Hide resolved
.github/actions/setup-env/action.yml Outdated Show resolved Hide resolved
paescuj and others added 3 commits August 6, 2024 10:40
Co-authored-by: Wryn (yage) Wagner <[email protected]>
Co-authored-by: Wryn (yage) Wagner <[email protected]>
Co-authored-by: Wryn (yage) Wagner <[email protected]>
Co-authored-by: Wryn (yage) Wagner <[email protected]>
Copy link
Member

@wrynegade wrynegade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good looking tests! 👍

I have a few more pedantic comments that I'll leave to your discretion, otherwise this looks good to me

.github/workflows/rebuild.yml Outdated Show resolved Hide resolved
@wrynegade
Copy link
Member

Oh I suppose we should probably be passing our own checks before we go live as well.

Does somebody with admin want to go put the standard rules on this for the repo / main? :)

Co-authored-by: Wryn (yage) Wagner <[email protected]>
@paescuj
Copy link
Member Author

paescuj commented Aug 20, 2024

Oh I suppose we should probably be passing our own checks before we go live as well.

Does somebody with admin want to go put the standard rules on this for the repo / main? :)

Yep, good point! I'll apply the rules.

@paescuj paescuj merged commit 224a500 into main Aug 20, 2024
2 of 4 checks passed
@paescuj paescuj deleted the init branch August 20, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants