Code Monkey home page Code Monkey logo

linear-app-create-issue-action's Introduction

linear-app-create-issue-action

GitHub Action to create an Issue for Linear.app.

build-test codecov

Usage

Input

See action.yml

arg description required type
issueFilePath File path of Issue markdown yes string
apiKey api key of Linear.app (ref) yes string
teamId team id of Linear.app (ref) yes string
stateId state id of Linear.app (ref) yes string
isDryrun enable dryrun (not create issue) no boolean
embed embed variable. (ex: "month=July,day=13") no string

Usage

Create Issue file

Create issue file in markdown format. Write the contents of IssueCreateInput in YAML format on the line enclosed by ---. title is required.

If you want to change the value of YAML dynamically, you can replace ${something} when executing the action.

example-issue.md

---
title: Issue file example (${day}, ${month}) # title is required
estimate: 1
---
This block is description.

## Items
* Item 1
* Item 2
* Item 3

## CheckBoxes
- [ ] CheckBox 1
- [ ] CheckBox 2

*created by [korosuke613/linear-app-create-issue-action](https://github.com/korosuke613/linear-app-create-issue-action)*

Create Workflow

Create a workflow .yml file in your repositories .github/workflows directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.

If you want to replace ${something} in YAML, use embed with key1=value1,key2=value2,....

create-issue-every-friday.yml

name: Create Issue every friday
on:
  schedule:
    - cron: "0 8 * * 5"  # At 08:00 on Friday (UTC).

jobs:
  create-issue:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: korosuke613/linear-app-create-issue-action@v1
        with:
          issueFilePath: "./example/example-issue.md"
          apiKey: ${{ secrets.YOUR_API_TOKEN_OF_LINEAR_APP }}
          teamId: ${{ secrets.YOUR_TEAM_ID_OF_LINEAR_APP }}
          stateId: ${{ secrets.YOUR_STATE_ID_OF_LINEAR_APP }}
          embed: month=July,day=13

result

FAQ

How do I get teamId and stateId?

Call the Linear API. An example is shown below.

teamId

input

curl \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: <Replace this with your Linear API Key>" \
  --data '{ "query": "{ teams { nodes { id name } } }" }' \
  https://api.linear.app/graphql | jq

output

{
  "data": {
    "teams": {
      "nodes": [
        {
          "id": "eeaa0cbd-xxxx-xxxx-xxxx-1c701c3485f1",
          "name": "korosuke613"
        }
      ]
    }
  }
}

stateId

input

curl \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: <Replace this with your Linear API Key>" \
  --data '{ "query": "{ workflowStates { nodes { id name type } } }" }' \
  https://api.linear.app/graphql | jq

output

{
  "data": {
    "workflowStates": {
      "nodes": [
        {
          "id": "76984209-xxxx-xxxx-xxxx-78eb458a7cbe",
          "name": "In Review",
          "type": "started"
        },
        {
          "id": "e788ada6-xxxx-xxxx-xxxx-5717c26104ad",
          "name": "Todo",
          "type": "unstarted"
        },
        {
          "id": "c02edc3a-xxxx-xxxx-xxxx-85c349766a13",
          "name": "Backlog",
          "type": "backlog"
        },
        // etc..
      ]
    }
  }
}

License

The scripts and documentation in this project are released under the MIT License

linear-app-create-issue-action's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar korosuke613 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.