Skip to content

Commit

Permalink
ci: only create dependencies issue if it's not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
swiatekm committed Nov 13, 2023
1 parent 57cbc57 commit 56ac7d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/check_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,21 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -r ci/check_dependencies/requirements.txt
- run: |
- name: Generate dependency report
id: dependency-report
run: |
cp ci/check_dependencies/issue_header.md issue.md
make check-dependencies | tail -n +3 >>issue.md
make check-dependencies >issue_content.md
cat issue_content.md >> issue.md
[ -s issue_content.md ] && EMPTY=false || EMPTY=true
echo "issue-file=issue.md" >> "$GITHUB_OUTPUT"
echo "empty=$empty" >> "$GITHUB_OUTPUT"
- uses: JasonEtco/create-an-issue@v2
if: ${{ ! steps.dependency-report.outputs.empty }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: ./issue.md
filename: ${{ steps.dependency-report.outputs.issue-file }}
update_existing: true
search_existing: all

Expand Down
2 changes: 1 addition & 1 deletion ci/check_dependencies/issue_header.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ labels: dependencies

This issue was automatically generated by the `check_dependencies` tool located in [ci/check_dependencies][ci_check_dependencies].

[ci_check_dependencies]: https://github.com/SumoLogic/sumologic-kubernetes-collection/tree/main/ci/check_dependencies
[ci_check_dependencies]: https://github.com/SumoLogic/sumologic-kubernetes-collection/tree/main/ci/check_dependencies

0 comments on commit 56ac7d5

Please sign in to comment.