dashboard-pr.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. name: Dashboard Version
  11. required: true
  12. jobs:
  13. dashboard-pr:
  14. name: Generate Dashboard Version Bump PR
  15. runs-on: ubuntu-latest
  16. steps:
  17. - name: Checkout
  18. uses: actions/checkout@v2
  19. - name: Create Branch
  20. # This is needed because we want to do a PR, and the commit
  21. # action used below requires the branch it is commiting to to
  22. # already exist.
  23. run: |
  24. git checkout -b dashboard-${{ github.event.inputs.dashboard_version }}
  25. git push -u origin dashboard-${{ github.event.inputs.dashboard_version }}
  26. - name: Update Files
  27. run: |
  28. web/gui/bundle_dashboard.py ${{ github.event.inputs.dashboard_version }}
  29. - name: Commit Changes
  30. uses: swinton/commit@v2.x
  31. env:
  32. GH_TOKEN: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  33. with:
  34. files: |
  35. packaging/dashboard.version
  36. packaging/dashboard.checksums
  37. commit-message: 'Update dashboard to version ${{ github.event.inputs.dashboard_version }}.'
  38. ref: refs/heads/dashboard-${{ github.event.inputs.dashboard_version }}
  39. - name: Create PR
  40. uses: repo-sync/pull-request@v2
  41. with:
  42. source_branch: dashboard-${{ github.event.inputs.dashboard_version }}
  43. pr_title: 'Update dashboard to version ${{ github.event.inputs.dashboard_version }}.'
  44. pr_body: 'See https://github.com/netdata/dashboard/releases/tag/${{ github.event.inputs.dashboard_version }} for changes.'
  45. github_token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}