Conversation
Co-authored-by: TimHess <3947063+TimHess@users.noreply.github.com>
Co-authored-by: TimHess <3947063+TimHess@users.noreply.github.com>
…umentation Co-authored-by: TimHess <3947063+TimHess@users.noreply.github.com>
Co-authored-by: TimHess <3947063+TimHess@users.noreply.github.com>
|
@copilot I didn't realize opening and closing a PR would be a viable solution here - can it be the same PR (or issue) that's closed/open/modified? If we could edit or open/close the same PR it would be even less of a hassle. Also, this process doesn't appear to require human intervention, so we can run it every 59 days and forget about the buffer window |
Co-authored-by: TimHess <3947063+TimHess@users.noreply.github.com>
Yes, great suggestions! I've updated the workflow to:
The workflow now:
Commit: cfa441d |
- bump a couple other action refs - whitespace cleanup
Co-authored-by: TimHess <3947063+TimHess@users.noreply.github.com>
Co-authored-by: TimHess <3947063+TimHess@users.noreply.github.com>
.github/workflows/keep-alive.yml
Outdated
| GH_TOKEN: ${{ github.token }} | ||
| shell: bash | ||
| run: | | ||
| # Skip keep-alive if repository has been active in last 30 days |
There was a problem hiding this comment.
| # Skip keep-alive if repository has been active in last 30 days | |
| # Determine if the repository has been active in the last 30 days. |
Or remove this comment entirely, as the step name already indicates it.
.github/workflows/keep-alive.yml
Outdated
| gh pr create \ | ||
| --draft \ | ||
| --head "$branch_name" \ | ||
| --base ${{ github.event.repository.default_branch }} \ |
There was a problem hiding this comment.
The step above has a fallback to main, which doesn't appear here. Is it redundant?
There was a problem hiding this comment.
looks like it's defense against a situation that effectively shouldn't be able to happen. probably not needed in either place, but don't see how it could hurt to include in both
.github/workflows/keep-alive.yml
Outdated
| pr_state=$(gh pr view "$pr_number" --json state --jq '.state') | ||
| echo "PR #$pr_number is $pr_state" | ||
|
|
||
| if [ "$pr_state" = "CLOSED" ]; then |
There was a problem hiding this comment.
I'm no bash expert, but this looks like an assignment to me. According to https://stackoverflow.com/a/4277753, the typical syntax uses double brackets:
if [[ "$pr_state" == "CLOSED" ]]
.github/workflows/keep-alive.yml
Outdated
| if [ "$pr_state" = "CLOSED" ]; then | ||
| echo "Reopening PR #$pr_number" | ||
| gh pr reopen "$pr_number" | ||
| sleep 2 |
There was a problem hiding this comment.
I don't think it would hurt, but the github UI responds fine to button clicks without a wait, so I don't see how it would help either
Co-authored-by: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
- shell vars all lowercase_with_underscores, env vars UPPER_SNAKE - consistent conditional formatting - consistent fallback for branch - reduce verbosity
.github/workflows/keep-alive.yml
Outdated
| GH_TOKEN: ${{ github.token }} | ||
| shell: bash | ||
| run: | | ||
| # Skip keep-alive if repository has been active in last 30 days |
.github/workflows/keep-alive.yml
Outdated
| if [ "$pr_state" = "CLOSED" ]; then | ||
| echo "Reopening PR #$pr_number" | ||
| gh pr reopen "$pr_number" | ||
| sleep 2 |
There was a problem hiding this comment.
I don't think it would hurt, but the github UI responds fine to button clicks without a wait, so I don't see how it would help either
.github/workflows/keep-alive.yml
Outdated
| gh pr create \ | ||
| --draft \ | ||
| --head "$branch_name" \ | ||
| --base ${{ github.event.repository.default_branch }} \ |
There was a problem hiding this comment.
looks like it's defense against a situation that effectively shouldn't be able to happen. probably not needed in either place, but don't see how it could hurt to include in both
GitHub disables scheduled workflows after 60 days of repository inactivity. This workflow prevents deactivation.
Implementation
keep-alive-workflowbranchWhy empty commits
Empty commits generate activity without modifying repository content. The draft PR is reopened/closed to register activity.
Fully automated. No human intervention required.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.