Merge pull request #14 from pwshdevs/update-workflow #11
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 Module Version | |
| on: | |
| push: | |
| branches: | |
| - develop # Trigger on pushes to the main branch | |
| workflow_dispatch: | |
| jobs: | |
| update_module_version: | |
| name: Update Module Version | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| permissions: | |
| contents: write | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v2 | |
| - name: Create Version From Current Tags | |
| uses: dexwritescode/release-on-merge-action@v1 # Or another suitable action | |
| id: version_tracker | |
| with: | |
| version-increment-strategy: patch | |
| dry-run: true | |
| initial-version: '1.0.0' | |
| - name: Modify the file | |
| run: | | |
| perl -pi -e 's/[0-9]\.[0-9]\.[0-9]/${{ steps.version_tracker.outputs.version }}/' DevSetup/DevSetup.psd1 | |
| # - name: Commit and push changes | |
| # uses: stefanzweifel/git-auto-commit-action@v5 | |
| # with: | |
| # commit_message: "Automated Release Tagging for ${{ steps.version_tracker.outputs.version }} in DevSetup.psd1" | |
| # branch: | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| commit-message: Automated Release Tagging for ${{ steps.version_tracker.outputs.version }} in DevSetup.psd1 | |
| title: Automated Release Tagging for ${{ steps.version_tracker.outputs.version }} in DevSetup.psd1 | |
| body: Changing version to ${{ steps.version_tracker.outputs.version }} | |
| branch: update-release-version-to-${{ steps.version_tracker.outputs.version }} | |
| token: ${{ secrets.WORKFLOW_TOKEN }} |