Skip to content

Commit

Permalink
add output has_new_commits to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aormsby committed Sep 23, 2020
1 parent 8a3316e commit 08dc455
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ As with any Github Action, you must include it in a workflow for your repo to ru

For **github_token** - use `${{ secrets.GITHUB_TOKEN }}` where `GITHUB_TOKEN` is the name of the secret in your repo ([see docs for help](https://docs.github.com/en/actions/configuring-and-managing-workflows/using-variables-and-secrets-in-a-workflow))

### Output Variables

**has_new_commits** - True when new commits were included in this sync

## Sync Process - Quick Overview

Right now, the `main.js` script only exists to execute `upstream-sync.sh`. It's possible that future updates will add functionality. The shell script does the following:
Expand Down Expand Up @@ -52,7 +56,7 @@ jobs:
uses: actions/checkout@v2
with:
ref: master

# Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch
- name: Pull upstream changes
id: sync
Expand All @@ -62,8 +66,13 @@ jobs:
upstream_branch: master
target_branch: master # optional
github_token: ${{ secrets.GITHUB_TOKEN }} # optional, for accessing repos that requir authentication

# Step 3: Print a helpful timestamp for your records (optional)

# Step 3: Display a message if 'sync' step had new commits (simple test)
- name: Check for new commits
if: steps.sync.outputs.has-new-commits
run: echo "There were new commits."

# Step 4: Print a helpful timestamp for your records (not required)
- name: Timestamp
run: date
```

0 comments on commit 08dc455

Please sign in to comment.