自動的にこのGithubアクション+ワークフローを使用して貢献者ファイルを更新します



マイワークフロー
私はオープンソースのメンテナにとってシンプルではあるが、何かを構築したいと思った.だからここで私は構築:自動的に生成するアクションCONTRIBUTORS.md プロジェクトのトップ貢献者に基づいて、プロジェクトに関する情報を引き出すためにGithub APIを使用します.ワークフローは、別のアクションを使用して、プル要求を作成したり、ワークフローを構成する同じリポジトリに直接変更をコミットします.

アクションが実行されるsingle-command application で作成Minicli , PHP CLIコマンドを構築するためのミニマリストコマンドラインフレームワーク
アプリケーション、アクション、およびサンプルのワークフローはここで見つかります.

minicli / action-contributors
貢献するファイルを動的に更新する
投稿者ファイルの生成/更新
このGithubアクションは、指定されたプロジェクトからトップの貢献者と共に貢献者ファイルを更新します.
使用例
このアクションはtest-room-7/action-update-file 自動的に一定の間隔で更新された貢献者ファイルをコミットする.
次の例では、ワークフローを設定して月に一度ファイルを更新し、主プロジェクトの分岐に直接変更します
name: Update CONTRIBUTORS file
on
  schedule:
    - cron: "0 0 1 * *"
  workflow_dispatch:
jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: minicli/[email protected]
        name: "Update a projects CONTRIBUTORS file"
        env:
          CONTRIB_REPOSITORY: 'minicli/minicli'
          CONTRIB_OUTPUT_FILE: 'CONTRIBUTORS.md'
      - name: Commit changes
        uses: test-room-7/[email protected]
        with:
          file-path: 'CONTRIBUTORS.md'
          commit-msg: Update Contributors

Note: If you want to learn how I built this, check out this post: .

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

Here is an example workflow to run this action once a month and commit the changes directly to the main project's branch:

name: Update CONTRIBUTORS file
on:
  schedule:
    - cron: "0 0 1 * *"
  workflow_dispatch:
jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: minicli/[email protected]
        name: 'Update a projects CONTRIBUTORS file'
        env:
          CONTRIB_REPOSITORY: 'minicli/minicli'
          CONTRIB_OUTPUT_FILE: 'CONTRIBUTORS.md'
      - name: Update resources
        uses: test-room-7/[email protected]
        with:
          file-path: 'CONTRIBUTORS.md'
          commit-msg: Update Contributors
          github-token: ${{ secrets.GITHUB_TOKEN }}
を置き換える必要がありますCONTRIB_REPOSITORY Githubプロジェクトを使用して、貢献者を引き離したい.
主ブランチに直接変更をコミットする代わりにプル要求を作成したい場合は、create-pull-request 代わりにアクション.そのためには、また、actions/checkout ギタブアクション
name: Update CONTRIBUTORS file
on:
  schedule:
    - cron: "0 0 1 * *"
  workflow_dispatch:
jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
      - uses: minicli/[email protected]
        name: "Update a projects CONTRIBUTORS file"
        env:
          CONTRIB_REPOSITORY: 'minicli/minicli'
          CONTRIB_OUTPUT_FILE: 'CONTRIBUTORS.md'
      - name: Create a PR
        uses: peter-evans/[email protected]
        with:
          commit-message: Update Contributors
          title: "[automated] Update Contributors File"
          token: ${{ secrets.GITHUB_TOKEN }}

追加情報
このアクションを使用したプロジェクト
  • minicli/minicli
  • minicli/docs
  • この方法を学びたいなら、この投稿をチェックしてください.