Merge pull request #2063 from cfengine/update-dependencies-action-mas… #307
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 dependency tables | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_call: | |
| workflow_dispatch: # Enables manual trigger | |
| jobs: | |
| update_dep_tables: | |
| name: Update dependency tables | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checks-out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: "master" | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install cfengine | |
| - name: Set Git user | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Save commit hash before | |
| run: | | |
| echo "COMMIT_HASH_BEFORE=$(git log -1 --format=%H)">> $GITHUB_ENV | |
| - name: Run dev command to update dependency tables | |
| run: cfengine dev update-dependency-tables | |
| - name: Save commit hash after | |
| run: | | |
| echo "COMMIT_HASH_AFTER=$(git log -1 --format=%H)">> $GITHUB_ENV | |
| - name: Create Pull Request | |
| if: env.COMMIT_HASH_BEFORE != env.COMMIT_HASH_AFTER | |
| uses: cfengine/create-pull-request@v6 | |
| with: | |
| title: Updated Markdown dependency tables | |
| body: Automated updates to the README.md Markdown dependency tables using [the `update_dep_tables` workflow](https://github.com/cfengine/buildscripts/blob/master/.github/workflows/update-dep-tables.yml). | |
| reviewers: | | |
| larsewi | |
| craigcomstock | |
| branch: update-dependency-tables | |
| branch-suffix: timestamp |