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

ci: add packages workflow #152

Merged
merged 1 commit into from
Feb 26, 2021
Merged
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
70 changes: 70 additions & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Update packages

on: [workflow_dispatch]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout PreREISE
uses: actions/checkout@v2
with:
path: PreREISE

- name: Checkout PowerSimData
uses: actions/checkout@v2
with:
repository: Breakthrough-Energy/PowerSimData
path: PowerSimData

- name: Pipenv lock
id: pipenv_lock
uses: Breakthrough-Energy/actions/update-packages@main
with:
repo-dir: PreREISE

- name: Parse JSON
id: parse_json
run: |
additions=$(echo $json_summary | jq '.Additions')
additions="${additions//$'\n'/'%0A'}"
echo "::set-output name=additions::$additions"
deletions=$(echo $json_summary | jq '.Deletions')
deletions="${deletions//$'\n'/'%0A'}"
echo "::set-output name=deletions::$deletions"
updates=$(echo $json_summary | jq '.Updates')
updates="${updates//$'\n'/'%0A'}"
echo "::set-output name=updates::$updates"
env:
json_summary: ${{ steps.pipenv_lock.outputs.summary }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.CI_TOKEN_CLONE_REPO }}
commit-message: Update dependencies
title: Update dependencies
delete-branch: true
body: |
### Summary of changes

- Additions
```
${{ steps.parse_json.outputs.additions }}
```
- Deletions
```
${{ steps.parse_json.outputs.deletions }}
```
- Updates
```
${{ steps.parse_json.outputs.updates }}
```

Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
branch: update-dependencies
path: PreREISE