Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making Action fail when diff fails to post #7

Merged
merged 6 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ jobs:
- run: |
npm install
npm run all

test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./
with:
milliseconds: 1000
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# ArgoCD Diff Github Action
# ArgoCD Diff GitHub Action

This action generates a diff between the current PR and the current state of the cluster.

Note that this includes any changes between your branch and latest master, as well as ways in which the cluster is out of sync.
Note that this includes any changes between your branch and latest `master`, as well as ways in which the cluster is out of sync.

# How to use it
## Usage

Example GH action:
```
```yaml
name: ArgoCD Diff

on:
pull_request:
branches: [ master ]
branches: [master, main]

jobs:
argocd-diff:
Expand All @@ -32,15 +33,16 @@ jobs:
argocd-extra-cli-args: --grpc-web
```

# How it works
1) Downloads the specified version of the ArgoCD binary, and makes it executable
2) Connects to the ArgoCD api using the argocd token, and gets all the apps
3) Filters the apps to the ones that live in the current repo
3) Runs `argocd app diff` for each app
5) Posts the diff output as a comment on the PR
## How it works

1. Downloads the specified version of the ArgoCD binary, and makes it executable
2. Connects to the ArgoCD API using the `argocd-token`, and gets all the apps
3. Filters the apps to the ones that live in the current repo
4. Runs `argocd app diff` for each app
5. Posts the diff output as a comment on the PR

## Publishing

# Publishing
Build the script and commit to your branch:
`npm run build && npm run pack`
Commit the build output, and make a PR

Commit the build output, and make a PR.
Loading