Skip to content

Latest commit

 

History

History
95 lines (75 loc) · 4.8 KB

scheduling-issue-creation.md

File metadata and controls

95 lines (75 loc) · 4.8 KB
title shortTitle intro redirect_from versions type topics
Scheduling issue creation
Schedule issue creation
You can use {% data variables.product.prodname_actions %} to create an issue on a regular basis for things like daily meetings or quarterly reviews.
/actions/guides/scheduling-issue-creation
fpt ghes ghae ghec
*
*
*
*
tutorial
Workflows
Project management

{% data reusables.actions.enterprise-beta %} {% data reusables.actions.enterprise-github-hosted-runners %}

Introduction

This tutorial demonstrates how to use the imjohnbo/issue-bot action to create an issue on a regular basis. For example, you can create an issue each week to use as the agenda for a team meeting.

In the tutorial, you will first make a workflow file that uses the imjohnbo/issue-bot action. Then, you will customize the workflow to suit your needs.

Creating the workflow

  1. {% data reusables.actions.choose-repo %}

  2. {% data reusables.actions.make-workflow-file %}

  3. Copy the following YAML contents into your workflow file.

{% indented_data_reference reusables.actions.actions-not-certified-by-github-comment spaces=4 %}

{% indented_data_reference reusables.actions.actions-use-sha-pinning-comment spaces=4 %}

name: Weekly Team Sync
on:
  schedule:
    - cron: 20 07 * * 1

jobs:
  create_issue:
    name: Create team sync issue
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - name: Create team sync issue
        uses: imjohnbo/issue-bot@3d96848fb5e9a4a473bb81ae62b4b4866a56e93a
        with:
          assignees: "monalisa, doctocat, hubot"
          labels: "weekly sync, docs-team"
          title: "Team sync"
          body: |
            ### Agenda

            - [ ] Start the recording
            - [ ] Check-ins
            - [ ] Discussion points
            - [ ] Post the recording
                    
            ### Discussion Points
            Add things to discuss below

            - [Work this week](https://github.com/orgs/github/projects/3)
          pinned: false
          close-previous: false
        env:
          GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
```
  1. Customize the parameters in your workflow file:
    • Change the value for on.schedule to dictate when you want this workflow to run. In the example above, the workflow will run every Monday at 7:20 UTC. For more information about scheduled workflows, see "AUTOTITLE."
    • Change the value for assignees to the list of {% data variables.product.prodname_dotcom %} usernames that you want to assign to the issue.
    • Change the value for labels to the list of labels that you want to apply to the issue.
    • Change the value for title to the title that you want the issue to have.
    • Change the value for body to the text that you want in the issue body. The | character allows you to use a multi-line value for this parameter.
    • If you want to pin this issue in your repository, set pinned to true. For more information about pinned issues, see "AUTOTITLE."
    • If you want to close the previous issue generated by this workflow each time a new issue is created, set close-previous to true. The workflow will close the most recent issue that has the labels defined in the labels field. To avoid closing the wrong issue, use a unique label or combination of labels.
  2. {% data reusables.actions.commit-workflow %}

Expected results

Based on the schedule parameter (for example, every Monday at 7:20 UTC), your workflow will create a new issue with the assignees, labels, title, and body that you specified. If you set pinned to true, the workflow will pin the issue to your repository. If you set close-previous to true, the workflow will close the most recent issue with matching labels.

{% data reusables.actions.schedule-delay %}

You can view the history of your workflow runs to see this workflow run periodically. For more information, see "AUTOTITLE."

Next steps