dashboard-pr.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. # Create a PR to update the react dashboard code.
  3. name: Dashboard Version PR
  4. on:
  5. workflow_dispatch:
  6. inputs:
  7. dashboard_version:
  8. # This must be specified, and must _exactly_ match the version
  9. # tag for the release to be used for the update.
  10. description: Dashboard Version
  11. required: true
  12. env:
  13. DISABLE_TELEMETRY: 1
  14. jobs:
  15. dashboard-pr:
  16. name: Generate Dashboard Version Bump PR
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Checkout
  20. id: checkout
  21. uses: actions/checkout@v4
  22. - name: Update Files
  23. id: update
  24. run: |
  25. src/web/gui/bundle_dashboard_v1.py ${{ github.event.inputs.dashboard_version }}
  26. - name: Create Pull Request
  27. id: pr
  28. uses: peter-evans/create-pull-request@v7
  29. with:
  30. title: 'Update dashboard to version ${{ github.event.inputs.dashboard_version }}.'
  31. body: 'See https://github.com/netdata/dashboard/releases/tag/${{ github.event.inputs.dashboard_version }} for changes.'
  32. branch: dashboard-${{ github.event.inputs.dashboard_version }}
  33. branch-suffix: timestamp
  34. delete-branch: true
  35. commit-message: 'Update dashboard to version ${{ github.event.inputs.dashboard_version }}.'
  36. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  37. - name: Failure Notification
  38. uses: rtCamp/action-slack-notify@v2
  39. env:
  40. SLACK_COLOR: 'danger'
  41. SLACK_FOOTER: ''
  42. SLACK_ICON_EMOJI: ':github-actions:'
  43. SLACK_TITLE: 'Dashboard update PR creation failed:'
  44. SLACK_USERNAME: 'GitHub Actions'
  45. SLACK_MESSAGE: |-
  46. ${{ github.repository }}: Failed to create PR to update dashboard code to newest release.
  47. Checkout: ${{ steps.checkout.outcome }}
  48. Update files: ${{ steps.update.outcome }}
  49. Create PR: ${{ steps.pr.outcome }}
  50. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  51. if: failure()