Skip to content

Github Action to change clickup task status based on branch.

Notifications You must be signed in to change notification settings

eteg/clickup-action

Repository files navigation

ClickUp Action

Github Action to change clickup task status based on branch.

📋 Table of contents

📦 Installation

Install the dependencies

yarn install

Run the tests ✔️

$ yarn test

 PASS  ./index.test.js
  ✓ test runs (95ms)
...

🔁 Change the Action

The action.yml defines the inputs and output for your action.

Update the action.yml and index.js if you want to make changes to the action.

⌨️ Change the Code

Most toolkit and CI/CD operations involve async operations so the action is run in an async function.

const core = require('@actions/core');
...

async function run() {
  try {
      ...
  }
  catch (error) {
    core.setFailed(error.message);
  }
}

run()

🚀 Usage

You can now consume the action by referencing the release branch, e.g.: @v1

uses: eteg/clickup-action@v1

This is a complete example of the action usage for development purposes.:

name: "clickup"
on:
  pull_request:
    branches:
      - main
      - develop
    types: [closed]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x]

    env:
      CLICKUP_PERSONAL_TOKEN: ${{ secrets.CLICKUP_PERSONAL_TOKEN }}

    steps:
      - name: Setup Checkout
        uses: actions/checkout@v3

      - name: Setup Node ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
          cache: npm
          cache-dependency-path: "./yarn.lock"

      - name: Setup ClickUp
        uses: eteg/clickup-action@v1
        with:
          CLICKUP_TEAM_ID: 3097350

NOTE: You must setup env variable CLICKUP_PERSONAL_TOKEN in Github Action Secrets

✉️ Package for distribution

GitHub Actions will run the entry point from the action.yml. Packaging assembles the code into one file that can be checked in to Git, enabling fast and reliable execution and preventing the need to check in node_modules.

Actions are run from GitHub repos. Packaging the action will create a packaged action in the dist folder.

Run prepare for distribution

yarn run prepare

Since the packaged index.js is run from the dist folder.

git add dist

🤯 Create a release branch

Users shouldn't consume the action from master since that would be latest code and actions can break compatibility between major versions.

Checkin to the v1 release branch

git checkout -b v1
git commit -a -m "v1 release"
git push origin v1

Your action is now published! 🚀

📜 License

This project have no license. You're under no obligation to choose a license. However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work. Github licensing page.

About

Github Action to change clickup task status based on branch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published