-
Notifications
You must be signed in to change notification settings - Fork 13
Create issue-manager.yml #75
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Issue Manager | ||
|
||
on: | ||
schedule: | ||
- cron: "13 22 * * *" | ||
issue_comment: | ||
types: | ||
- created | ||
issues: | ||
types: | ||
- labeled | ||
pull_request_target: | ||
types: | ||
- labeled | ||
workflow_dispatch: | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
issue-manager: | ||
if: github.repository_owner == 'khulnasoft' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(pick(github, ['event_name', 'repository', 'issue.number'])) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
Comment on lines
+26
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix GitHub context filtering syntax The - GITHUB_CONTEXT: ${{ toJson(pick(github, ['event_name', 'repository', 'issue.number'])) }}
+ GITHUB_CONTEXT: ${{ toJson(github) | jq '{event_name: .event_name, repository: .repository, issue_number: .issue.number}' }}
🧰 Tools🪛 actionlint (1.7.4)28-28: unexpected token "[" while parsing variable access, function call, null, bool, int, float or string. expecting "IDENT", "(", "INTEGER", "FLOAT", "STRING" (expression) |
||
- uses: khulnasoft/issue-manager@0.5.1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
config: > | ||
{ | ||
"answered": { | ||
"delay": 864000, | ||
"message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs." | ||
}, | ||
"waiting": { | ||
"delay": 2628000, | ||
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR." | ||
}, | ||
"invalid": { | ||
"delay": 0, | ||
"message": "This was marked as invalid and will be closed now. If this is an error, please provide additional details." | ||
} | ||
} | ||
Comment on lines
+30
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Missing required labels for issue-manager automation The repository is missing the "answered" and "waiting" labels that are required for the issue-manager automation to work properly. Only the "invalid" label exists.
🔗 Analysis chainConsider adding configuration documentation The configuration looks good, but consider adding comments to explain:
Example: config: >
{
+ // Close answered issues after 10 days of inactivity
"answered": {
"delay": 864000,
"message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
}, Also, verify that these labels exist in the repository: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check if required labels exist in the repository
gh label list | grep -E "answered|waiting|invalid"
Length of output: 92 |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,25 @@ | ||||||||||||||||||
name: Latest Changes | ||||||||||||||||||
|
||||||||||||||||||
on: | ||||||||||||||||||
pull_request_target: | ||||||||||||||||||
branches: | ||||||||||||||||||
- master | ||||||||||||||||||
types: | ||||||||||||||||||
- closed | ||||||||||||||||||
workflow_dispatch: | ||||||||||||||||||
inputs: | ||||||||||||||||||
number: | ||||||||||||||||||
description: PR number | ||||||||||||||||||
required: true | ||||||||||||||||||
|
||||||||||||||||||
jobs: | ||||||||||||||||||
latest-changes: | ||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||
steps: | ||||||||||||||||||
- uses: actions/checkout@v4 | ||||||||||||||||||
with: | ||||||||||||||||||
# To allow latest-changes to commit to master | ||||||||||||||||||
token: ${{ secrets.ORG_REPO_TOKEN }} | ||||||||||||||||||
- uses: khulnasoft/latest-changes@0.3.2 | ||||||||||||||||||
Comment on lines
+19
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Token configuration is correct but missing latest-changes configuration The
Required configuration:
🔗 Analysis chainVerify ORG_REPO_TOKEN permissions and availability The workflow uses
Let's verify the secret usage across workflows: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check for ORG_REPO_TOKEN usage
rg "ORG_REPO_TOKEN" .github/workflows/
Length of output: 555 Script: #!/bin/bash
# Check latest-changes.yml workflow configuration
cat .github/workflows/latest-changes.yml
Length of output: 566 |
||||||||||||||||||
with: | ||||||||||||||||||
token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||
Comment on lines
+23
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add configuration for latest-changes action The
Consider adding these configurations to better control the changelog generation. - uses: khulnasoft/latest-changes@0.3.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
+ path: CHANGELOG.md
+ latest-changes-file: LATEST_CHANGES.md 📝 Committable suggestion
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security: Review
pull_request_target
trigger usageThe workflow uses
pull_request_target
which runs with repository secrets and write permissions in the context of the base repository. This could be dangerous if the workflow checks out and runs code from the PR.Consider:
pull_request
instead if you don't need access to secretspull_request_target
is necessary, ensure no untrusted code from the PR is checked out or executedAdditionally, consider specifying which labels should trigger the workflow to prevent unnecessary runs:
pull_request_target: types: - labeled + if: contains(['answered', 'waiting', 'invalid'], github.event.label.name)