aormsby / Fork-Sync-With-Upstream-action

An action to automatically update your fork with new commits from the upstream repo
MIT License
258 stars 70 forks source link

[Output variable] List of specific file changes #68

Open LangLangBart opened 1 year ago

LangLangBart commented 1 year ago

description

use case

# example with a made up variable called 'file_changes_include'
    - name: New commits found and it includes '.cpp' changes
      if: |
        (steps.sync.outputs.has_new_commits == 'true' &&
        steps.sync.outputs.file_changes_include == '*cpp*')
      run: |
        echo "New commits were found to sync."
        make

PS: The action works very well, a good job of you to make it available to the public.

LangLangBart commented 1 year ago
    steps:
      - uses: actions/checkout@v3
      - uses: aormsby/Fork-Sync-With-Upstream-action@main
        id: sync
        with:
          # rebase the local branch on top of the remote changes
          git_config_pull_rebase: true
          target_sync_branch: testing
          target_repo_token: ${{ secrets.GITHUB_TOKEN }}
          # list
          git_log_format_args: --pretty=format:"" --patch --name-only
          # force push, because of the rebase
          target_branch_push_args: --force
          upstream_sync_branch: master
          upstream_sync_repo: 0ad/0ad
          upstream_pull_args: --ff --no-edit
          test_mode: false