-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Create issue metrics workflow #278
Conversation
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.
@anupdsouza I have a few questions just looking over the yml file, I haven't done this before, but just looking at the workflow you've written so far I wanted to clarify some of it, for my understanding
To set up auto trigger via cron jobs, just add the following under workflow_dispatch:
Is it possible for GitHub actions to trigger this, rather than it running as a cron job?
- name: Run issue-metrics tool for opened issues last week | ||
uses: github/issue-metrics@v2 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
Do I need to do anything with this? Do I need to create some kind of secret for this to be able to create issues?
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.
Not required, as per Github documentation:
If you want the resulting issue with the metrics in it to appear in a different repository other than the one the workflow file runs in, update the line token: ${{ secrets.GITHUB_TOKEN }} with your own GitHub API token stored as a repository secret.
# Calculate the first day of the previous month | ||
#first_day=$(date -d "last month" +%Y-%m-01) | ||
|
||
# Calculate the last day of the previous month | ||
#last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d) | ||
|
||
#Set an environment variable with the date range | ||
#echo "$first_day..$last_day" | ||
#echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV" |
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.
Is this used for anything? It looks like it's all commented out?
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.
Not used at the moment. I left it in as a reference if you wanted to update the workflow such that it'd fetch reports for the previous month instead of the previous week.
As per Github documentation, the example uses cron job to schedule it to run once a month.
I suppose the workflow could be updated to run every time PR's are created or merged by doing something like this:
but that would result in too many reports being generated. That's why I left it to be run manually. |
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.
Thanks so much for working on this forever ago! Finally getting around to wrapping some of this up and I'm excited to see this work for the upcoming Hacktoberfest
I just tried to run it and it failed, sadly, you can take a look at this anytime if you want to jump back into it, otherwise I'll fix it sometime now to October haha https://github.com/mikaelacaron/Basic-Car-Maintenance/actions/runs/10089980810/job/27898454351 |
What it Does
How I Tested
Notes
Screenshots