Update version in SetupForDevelopment.sh script #52
This file contains 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 version in SetupForDevelopment.sh script | |
on: | |
schedule: | |
# Every day at 7.00am UTC (7.30am ET) | |
- cron: "30 11 * * *" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
update-SetupForDevelopment-version: | |
name: Update version in SetupForDevelopment.sh script | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
- name: Update SetupForDevelopment.sh | |
run: | | |
script_revision_count=$(git rev-list --count HEAD -- Utilities/SetupForDevelopment.sh) | |
echo "script_revision_count [${script_revision_count}]" | |
hooks_rev_count=$(git rev-list --count origin/hooks) | |
echo "hooks_rev_count [${hooks_rev_count}]" | |
SetupForDevelopment_VERSION=$(($script_revision_count + $hooks_rev_count)) | |
echo "SetupForDevelopment_VERSION [${SetupForDevelopment_VERSION}]" | |
sed -i "s/^SetupForDevelopment_VERSION=[0-9]\+$/SetupForDevelopment_VERSION=${SetupForDevelopment_VERSION}/" \ | |
Utilities/SetupForDevelopment.sh | |
- name: Get SHA of the branch that triggered the workflow run | |
id: head_branch | |
run: | | |
sha=$(git rev-parse ${{ github.ref }}) | |
echo "sha=${sha}" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 | |
with: | |
token: ${{ secrets.SLICERBOT_GITHUB_TOKEN }} | |
commit-message: | | |
ENH: Update version in SetupForDevelopment.sh script | |
This commit updates the version set in the `SetupForDevelopment.sh` script by | |
summing the number of revisions associated with this script and the "hooks" branch. | |
It was auto-generated by the [update-SetupForDevelopment-version][1] GitHub Actions workflow. | |
[1]: https://github.com/${{ github.repository }}/blob/${{ steps.head_branch.outputs.sha }}/.github/workflows/update-SetupForDevelopment-version.yml | |
committer: Slicer Bot <[email protected]> | |
author: Slicer Bot <[email protected]> | |
signoff: false | |
branch: slicerbot/update-SetupForDevelopment-hook-version | |
delete-branch: true | |
title: "Update version in SetupForDevelopment.sh" | |
body: | | |
This pull-request was auto-generated by the [update-SetupForDevelopment-version][1] GitHub Actions workflow. | |
[1]: https://github.com/${{ github.repository }}/blob/${{ steps.head_branch.outputs.sha }}/.github/workflows/update-SetupForDevelopment-version.yml | |
draft: false |