Update package #2103
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update package | |
| on: | |
| pull_request: | |
| push: | |
| branches: main | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: get latest dvc version | |
| id: latest | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: echo "version=$(./latest.sh)" >> $GITHUB_OUTPUT | |
| - name: try update | |
| id: update | |
| shell: bash | |
| run: | | |
| echo latest version ${{ steps.latest.outputs.version }} | |
| ./update.sh ${{ steps.latest.outputs.version }} | |
| echo "changes=$(git diff | tr '\n' ' ')" >> $GITHUB_OUTPUT | |
| - name: create PR | |
| if: ${{ steps.update.outputs.changes != '' && github.event_name != 'pull_request'}} | |
| id: create-pr | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| commit-message: updated dvc to ${{ steps.latest.outputs.version }} | |
| title: dvc ${{ steps.latest.outputs.version }} | |
| # - name: Merge the PR | |
| # if: ${{ steps.update.outputs.changes != '' && github.event_name != 'pull_request'}} | |
| # run: gh pr merge --squash --delete-branch --auto ${{ steps.create-pr.outputs.pull-request-url }} | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.OLIVAW_PAT }} | |
| - name: Send message to slack | |
| if: failure() | |
| uses: rtCamp/[email protected] | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| SLACK_COLOR: ${{ job.status }} | |
| SLACK_MESSAGE: 'Package update failed for ${{ github.repository }}' | |
| SLACK_TITLE: CI Status | |
| SLACK_USERNAME: dvc-pkg-update |