Skip to content

Commit

Permalink
Merge pull request #7 from quizlet/karoun/fail-loud
Browse files Browse the repository at this point in the history
Making Action fail when diff fails to post
  • Loading branch information
karoun authored Mar 10, 2021
2 parents 300f73f + 4f7d9f9 commit 2d094d4
Show file tree
Hide file tree
Showing 6 changed files with 15,152 additions and 6,704 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- 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: actions/checkout@v2
- 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

0 comments on commit 2d094d4

Please sign in to comment.