Open sawanverma opened 1 year ago
What version are you running?
aormsby/Fork-Sync-With-Upstream-action@v3.4.
steps:
# Step 1: run a standard checkout action, provided by github
- name: Checkout target repo
uses: actions/checkout@v2
with:
ref: stage
# REQUIRED if your upstream repo is private (see wiki)
persist-credentials: false
name: Sync upstream changes id: sync uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 with: target_sync_branch: stage
target_repo_token: ${{ secrets.WORKFLOW_TOKEN }}
upstream_sync_branch: master
upstream_sync_repo: my_upstream_repo
upstream_repo_access_token: ${{ secrets.WORKFLOW_TOKEN }}
# Set test_mode true to run tests instead of the true action!!
test_mode: false
name: New commits found if: steps.sync.outputs.has_new_commits == 'true' run: echo "New commits were found to sync."
name: No new commits if: steps.sync.outputs.has_new_commits == 'false' run: echo "There were no new commits."
While running the action, I also found that there was this following error
fatal: could not read Username for 'https://github.com/': No such device or address
Sync upstream changes ----> 28s Run aormsby/Fork-Sync-With-Upstream-action@v3.4 with: target_sync_branch: stage target_repo_token: upstream_sync_branch: master upstream_sync_repo: my_upstream_repo upstream_repo_access_token: test_mode: false git_log_format_args: --pretty=oneline git_config_user: GH Action - Upstream Sync git_config_email: action@github.com git_config_pull_rebase: false host_domain: github.com shallow_since: 1 month ago /usr/bin/sh /home/runner/work/_actions/aormsby/Fork-Sync-With-Upstream-action/v3.4/entry/config_and_run.sh Running ACTION...
Setting git config from input vars. (Skips config for all inputs set to 'null'.) SUCCESS
Checking out target branch 'stage' for sync. Already on 'stage' Your branch is up to date with 'origin/stage'. Target branch checked out SUCCESS
Setting upstream repo to 'my_upstream_repo'. SUCCESS
Checking for new commits on upstream branch.
fatal: could not read Username for 'https://github.com/': No such device or address
No previous sync found from upstream repo. Syncing entire commit history.
Syncing new commits... Nothing new to pack. From https://github.com/my_upstream_repo
Pushing synced data to target branch. Everything up-to-date SUCCESS
Resetting git config to previous settings. Reset Complete
Action Complete New Commits Found-------> 0s Run echo "New commits were found to sync." echo "New commits were found to sync." shell: /usr/bin/bash -e {0} New commits were found to sync.
My question is since as per above, it says Everything up-to-date, then why its finding new commit?
What I am missing here? Can you please let me know? Thanks in advance for all the help.
The output syntax was updated in #57. I wonder if maybe the syntax in the actions.yml
file needs to be updated also. Not sure, will have to look over the docs.
I believe the problem is this line https://github.com/aormsby/Fork-Sync-With-Upstream-action/blob/1090e365224fc834e7e1de521c417ded2d6fcb53/run/get_updates.sh#L28
It should be -z
instead of -n
. If the hash (commit) is included, the name of the branch is output hence non-empty. Otherwise it's empty (and the error message goes to stderr).
So the work around would be to invert the boolean in your action for the current version. Remove the inversion once fixed.
Even if the target branch is up to date with the upstream repo, the has_new_commits always returns true. I wanted to run another step but this issue is blocking. Can you please suggest?