This repository has been archived by the owner on Sep 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change to checking failure in example and print changes as output
- Loading branch information
Sakari Mursu
committed
Sep 30, 2020
1 parent
bf0dbf2
commit 5858f1c
Showing
5 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
on: [push] | ||
|
||
name: Check uncommitted changes and print them out | ||
jobs: | ||
check-uncommitted-changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Make uncommitted changes by creating empty file | ||
run: touch uncommitted.tmp | ||
- name: Check for uncommitted changes | ||
id: check-changes | ||
uses: ./ | ||
- name: Print uncommitted changes | ||
if: steps.check-changes.outputs.changes != '' | ||
run: echo ${{ steps.check-changes.outputs.changes }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,7 @@ A GitHub action for checking if repository has uncommitted changes. | |
|
||
### `changes` | ||
|
||
Value indicating if there are uncommitted changes in the repository. If `changed` is equal to `1` | ||
there are uncommitted changes. No changes will return `0`. | ||
Changes outputted by `git status --porcelain`. | ||
|
||
### Example usage | ||
|
||
|
@@ -26,7 +25,26 @@ jobs: | |
id: check-changes | ||
uses: mskri/[email protected] | ||
- name: Evaluate if there are changes | ||
if: steps.check-changes.outputs.changes == 1 | ||
if: steps.check-changes.outputs.outcome == failure() | ||
run: echo "There are uncommitted changes" | ||
``` | ||
```yaml | ||
name: Check uncommitted changes and print them out | ||
jobs: | ||
check-uncommitted-changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Make uncommitted changes by creating empty file | ||
run: touch uncommitted.tmp | ||
- name: Check for uncommitted changes | ||
id: check-changes | ||
uses: mskri/[email protected] | ||
- name: Print uncommitted changes | ||
if: steps.check-changes.outputs.changes != '' | ||
run: echo "There are uncommitted changes" | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
name: "Check uncommitted changes" | ||
description: "Checks if a git repository has uncommitted changes" | ||
branding: | ||
icon: "alert-circle" | ||
color: "yellow" | ||
outputs: | ||
changes: | ||
description: "Value indicating if there are uncommitted changes in the repository" | ||
description: "Uncommitted changes if any" | ||
runs: | ||
using: "docker" | ||
image: "Dockerfile" | ||
branding: | ||
icon: "alert-circle" | ||
color: "yellow" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters