DEV Community

Cover image for Auto change repo name with Github action
Tran Nguyen Thuong Truong
Tran Nguyen Thuong Truong

Posted on • Edited on

4 3

Auto change repo name with Github action

Introduction

  • I have just released repo that uses Github API and Github Action to watching to auto rename your repository through Variable Environment
  • After you click to the star repository button, the action workflow will be run, and after 60 seconds, the name and description of the repository will be updated to change.

Usage

  • 1 Create secret key ENV with name id RUN_TOKEN in setting -> developer setting
  • Create run.yml job file in .github/workflow folder
1. Default
  • Visit Autoname on Maket place
  • Click on Use latest version button
  • Copy the code below and paste it into your run.yml file
2. Self-host
name: "Run"

on:
  workflow_dispatch:
  watch:
    types: [started,fork]

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - run: npm i
      - uses: ./
        with:
          githubToken: ${{ secrets.RUN_TOKEN }}
          actor: ${{ github.actor }}
Enter fullscreen mode Exit fullscreen mode

Options

  • See example action at here

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay