Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,51 @@ concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
code: ${{ steps.classify.outputs.code }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- id: classify
name: Classify changed paths
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
PUSH_BASE: ${{ github.event.before }}
PR_BASE: ${{ github.event.pull_request.base.sha }}
run: |
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
echo "code=true" >> "$GITHUB_OUTPUT"
exit 0
fi
base="$PUSH_BASE"
if [[ "$EVENT_NAME" == "pull_request" ]]; then
base="$PR_BASE"
fi
if [[ -z "$base" || "$base" =~ ^0+$ ]] || ! git cat-file -e "$base^{commit}"; then
echo "code=true" >> "$GITHUB_OUTPUT"
exit 0
fi
code=false
while IFS= read -r path; do
case "$path" in
*.md|LICENSE|NOTICE|.github/ISSUE_TEMPLATE/*)
;;
*)
code=true
break
;;
esac
done < <(git diff --name-only "$base" "$GITHUB_SHA")
echo "code=$code" >> "$GITHUB_OUTPUT"
test:
needs: changes
if: needs.changes.outputs.code == 'true'
strategy:
fail-fast: false
matrix:
Expand All @@ -35,6 +79,8 @@ jobs:
- run: go vet ./...
- run: git diff --check
security:
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand All @@ -52,3 +98,22 @@ jobs:
GOOS: windows
GOARCH: amd64
run: go build ./cmd/coned
required:
needs: [changes, test, security]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Verify required jobs
shell: bash
env:
CHANGE_RESULT: ${{ needs.changes.result }}
CODE_CHANGED: ${{ needs.changes.outputs.code }}
TEST_RESULT: ${{ needs.test.result }}
SECURITY_RESULT: ${{ needs.security.result }}
run: |
test "$CHANGE_RESULT" = "success"
if [[ "$CODE_CHANGED" == "true" ]]; then
test "$TEST_RESULT" = "success"
test "$SECURITY_RESULT" = "success"
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Report vulnerabilities privately according to [SECURITY.md](SECURITY.md). See [d

## Disclaimer

This project uses unsupported Con Edison web interfaces, which may change without notice. It is intended only for account holders and authorized agents accessing data they are permitted to view. Users are responsible for complying with their utility agreements and applicable terms. The software does not bypass access controls.
This project interoperates with non-public web interfaces used by Con Edison’s My Account site. These interfaces are not offered as a documented or supported developer API and may change without notice. It is intended only for account holders and authorized agents accessing data they are permitted to view. Users are responsible for complying with their utility agreements and applicable terms. The software does not bypass access controls.

This project is not affiliated with or endorsed by Consolidated Edison, Inc., Opower, or Oracle. “Con Edison” and related marks belong to their respective owners.

Expand Down
Loading