action-sync-node-meta

授权协议 MIT License
开发语言 Python
所属分类 应用工具、 IM/聊天/语音工具
软件类型 开源软件
地区 不详
投 递 者 郎伟兆
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

action-sync-node-meta


GitHub Action that syncs package.json with the repository metadata.

There are values that are meant to be the same. Why not automatically keep them synchronized?

Example output

Example

overwrite-file

Example workflow that runs whenever commits are pushed on branch master.
This will overwrite the package.json file if it differs from the GitHub repository info.

This is the recommended syncing direction, because of the more simple setup (no need to manually add a secret to the repository settings) and the advantages of git commits (better monitoring, revertability).

.github/workflows/example.yml

name: Sync package.json with repository info
on:
  push:
    branches: [master]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: actions/checkout
        uses: actions/checkout@v2.3.4
      - name: Jaid/action-sync-node-meta
        uses: jaid/action-sync-node-meta@v2.0.0
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}

overwrite-github

Example workflow that runs whenever commits are pushed on branch master.
This will change the GitHub repository info whenever it differs from the content of package.json.

The secret customGithubToken is forwarded to the input githubToken. It has to be a personal access token with scope "repo" added in your repository's secrets settings.

.github/workflows/example2.yml

name: Sync repository info with package.json
on:
  push:
    branches: [master]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: actions/checkout
        uses: actions/checkout@v2.3.4
      - name: Jaid/action-sync-node-meta
        uses: jaid/action-sync-node-meta@v2.0.0
        with:
          direction: overwrite-github
          githubToken: ${{ secrets.customGithubToken }}
Detailed setupGo to your account settings and then to “Developer settings”.

Go to “Personal access tokens”.

Click “Generate new token”.

Give it a good title, so you still know what your token does in one year. Add „repo“ permissions.

Copy the generated token.

Go to the repository that uses action-sync-node-meta. Go to “Settings”, “Secrets”.

Click “New repository secret”.

Add the secret token from your clipboard. Name the token “repoGithubToken” or anything you like.

Now pass the token to action-sync-node-meta in your workflow file.

- name: Jaid/action-sync-node-meta
  uses: jaid/action-sync-node-meta@v2.0.0
  with:
    direction: overwrite-github
    githubToken: ${{ secrets.repoGithubToken }}

Options

Default Info
githubToken * Repository token for allowing the action to make commits or change the repository info. If direction is "overwrite-file", this input be set from forwarding secrets.GITHUB_TOKEN in the workflow file. If direction is "overwrite-github", a custom personal access token with "repo" scope has to be created.
approve true If true and direction is "overwrite-file", pull requests created by this action are automatically approved and merged.
branch action-sync-node-meta The name of the branch to make changes on (only for direction "overwrite-file"). Substring “{random}” will be replaced with randomized characters.
commitMessage autofix: Updated package.json[{changes}] Commit message for package.json changes (only for direction "overwrite-file"). Substring “{changes}” will be replaced with a list of changed package.json fields.
direction overwrite-file The syncing direction, can be "overwrite-file" or "overwrite-github". If "overwrite-file", the file package.json will be edited in a pull request according to the GitHub repository info. If "overwrite-github", the GitHub repository info will be changed according to the content of the package.json file.
jsonFinalNewline true If true and direction is "overwrite-file", the updated package.json will have a final newline.
removeBranch true If true and direction is "overwrite-file" and approve is also true, automatically merged pull requests will delete their branch afterwards.
syncDescription true If true, package.json[description] will be synced with GitHub repository description.
syncHomepage true If true, package.json[homepage] will be synced with GitHub repository homepage.
syncKeywords true If true, package.json[keywords] will be synced with GitHub repository topics.

Development

Setting up:

git clone git@github.com:jaid/action-sync-node-meta.git
cd action-sync-node-meta
npm install

License

MIT License
Copyright © 2021, Jaid <jaid.jsx@gmail.com> (https://github.com/jaid)

  • 1 NodeJS nodejs是运行在服务器端的一门语言 NodeJs有三大特点: 单线程,非阻塞IO,事件驱动 单线程: 整个程序只有一条线程执行(同一时间只能做一件事) 非阻塞I/O: I/O:input/output 输入/输出 input:从磁盘中输入内容到内存中 output:从内存中读取内容到磁盘中 非阻塞I/O:当线程执行的时候,如果遇到了I/O操作,只是开启一个

 相关资料
  • GitHub Action to Sync S3 Bucket �� This simple action uses the vanilla AWS CLI to sync a directory (either from your repository or generated during your workflow) with a remote S3 bucket. Usage workfl

  • sync(将缓冲区数据写回磁盘) 相关函数 fsync 表头文件 #include<unistd.h> 定义函数 int sync(void) 函数说明 sync()负责将系统缓冲区数据写回磁盘,以确保数据同步。 返回值 返回0。 范例: 无

  • SYNC 用于复制功能(replication)的内部命令。 更多信息请参考 Redis 官网的 Replication 章节 。 可用版本: >= 1.0.0 时间复杂度: 不明确 返回值: 不明确 redis> SYNC "REDIS0002\xfe\x00\x00\auser_id\xc0\x03\x00\anumbers\xc2\xf3\xe0\x01\x00\x00\tdb_number

  • 描述 (Description) 它使用Backbone.sync将集合的状态持久保存到服务器。 语法 (Syntax) collection.sync(method, collection, options) 参数 (Parameters) method - 它表示CRUD操作,如创建,读取,更新和删除。 collection - 它包含一组用于保存集合中数据的模型。 options - 根据

  • 描述 (Description) 它可用于与服务器通信并表示模型的状态。 语法 (Syntax) model.sync(method,model,options) 参数 (Parameters) method - 它表示CRUD操作,如创建,读取,更新和删除。 model - 用于保存模型上的数据。 options - 根据成功的方法触发成功或错误消息。 例子 (Example) <!DOCTY

  • 它用于将模型的状态持久保存到服务器。 下表列出了可用于操作BackboneJS-Sync - S.No. 方法和描述 1 Backbone.sync 它将模型的状态持久保存到服务器。 2 Backbone.ajax 它定义了自定义ajax函数。 3 Backbone.emulateHTTP 如果您的Web服务器不支持REST或HTTP方法,请打开Backbone.emulateHTTP。 4 Ba