Skip to content

Commit

Permalink
Create netbox.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fbouynot authored Apr 8, 2024
1 parent 268afc7 commit f0189c7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/netbox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Open Issue when Netbox releases a new version
on:
schedule:
- cron: 30 * * * *

jobs:
create_issue:
name: Create team sync issue
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create team sync issue
run: |
previous_issue_date=$(gh issue list \
--json createdAt \
-s all \
-S '[Chore]: Upgrade Netbox to' \
-L 1 \
--jq '.[0].createdAt')
new_release=$(gh release list -R netbox-community/netbox \
--exclude-drafts \
--exclude-pre-releases \
--json publishedAt,tagName \
--jq '.[0]')
new_release_tag=$(echo $new_release | jq '.tagName')
new_release_date=$(echo $new_release | jq '.publishedAt')
if [[ "$previous_issue_date" > "$new_release_date" ]]; then
body=$(gh release view $new_release_tag --repo netbox-community/netbox)
gh issue create \
--title "[Chore]: Upgrade netbox to $new_release_tag" \
--body "$body"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}

0 comments on commit f0189c7

Please sign in to comment.