Skip to content

Commit 7021dc6

Browse files
Update use-github-cli.md
name: Report remaining open issues on: schedule: # Daily at 8:20 UTC - cron: '20 8 * * *' jobs: track_pr: runs-on: ubuntu-latest steps: - run: | numOpenIssues="$(gh api graphql -F owner=$OWNER -F name=$REPO -f query=' query($name: String!, $owner: String!) { repository(owner: $owner, name: $name) { issues(states:OPEN){ totalCount } } } ' --jq '.data.repository.issues.totalCount')" echo 'NUM_OPEN_ISSUES='$numOpenIssues >> $GITHUB_ENV env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} - run: | gh issue create --title "Issue report" --body "$NUM_OPEN_ISSUES issues remaining" --repo $GITHUB_REPOSITORY env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 parent 4f731f6 commit 7021dc6

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

content/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,32 @@ jobs:
7474
env:
7575
GH_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
7676
```
77+
name: Report remaining open issues
78+
on:
79+
schedule:
80+
# Daily at 8:20 UTC
81+
- cron: '20 8 * * *'
82+
jobs:
83+
track_pr:
84+
runs-on: ubuntu-latest
85+
steps:
86+
- run: |
87+
numOpenIssues="$(gh api graphql -F owner=$OWNER -F name=$REPO -f query='
88+
query($name: String!, $owner: String!) {
89+
repository(owner: $owner, name: $name) {
90+
issues(states:OPEN){
91+
totalCount
92+
}
93+
}
94+
}
95+
' --jq '.data.repository.issues.totalCount')"
96+
97+
echo 'NUM_OPEN_ISSUES='$numOpenIssues >> $GITHUB_ENV
98+
env:
99+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
OWNER: ${{ github.repository_owner }}
101+
REPO: ${{ github.event.repository.name }}
102+
- run: |
103+
gh issue create --title "Issue report" --body "$NUM_OPEN_ISSUES issues remaining" --repo $GITHUB_REPOSITORY
104+
env:
105+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)