Skip to content

Commit 67d68b6

Browse files
committed
Update workflow to create PR for CLI version updates
- πŸ”§ Update gulpfile.mjs with new CLI version if needed - πŸ“„ Create Pull Request instead of GitHub issue for updates - πŸ—‘οΈ Remove issue content generation steps -Priyanshu
1 parent b194f05 commit 67d68b6

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

β€Ž.github/workflows/update-pac-cli-version.ymlβ€Ž

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
jobs:
1313
check-and-update-cli-version:
1414
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
1519
steps:
1620
- name: Checkout repository
1721
uses: actions/checkout@v4
@@ -42,25 +46,25 @@ jobs:
4246
echo "update_needed=false" >> $GITHUB_OUTPUT
4347
fi
4448
45-
- name: Generate issue content file
49+
- name: Update gulpfile.mjs with new CLI version
4650
if: steps.compare_versions.outputs.update_needed == 'true'
4751
run: |
48-
echo "A new version of Microsoft.PowerApps.CLI is available on NuGet." > .github/cli-update-issue-template.md
49-
echo "" >> .github/cli-update-issue-template.md
50-
echo "Current version in gulpfile.mjs: ${{ steps.get_current_version.outputs.current_version }}" >> .github/cli-update-issue-template.md
51-
echo "Latest version on NuGet: ${{ steps.get_latest_version.outputs.latest_version }}" >> .github/cli-update-issue-template.md
52-
echo "" >> .github/cli-update-issue-template.md
53-
echo "Please update the CLI version in the repository." >> .github/cli-update-issue-template.md
54-
echo "" >> .github/cli-update-issue-template.md
55-
echo "For implementation reference, see PR #1236." >> .github/cli-update-issue-template.md
52+
sed -i "s/const cliVersion = '[0-9.]*'/const cliVersion = '${{ steps.get_latest_version.outputs.latest_version }}'/" gulpfile.mjs
5653
57-
- name: Create GitHub issue to update CLI version and assign to Copilot
54+
- name: Create Pull Request to update CLI version
5855
if: steps.compare_versions.outputs.update_needed == 'true'
59-
uses: peter-evans/create-issue-from-file@v5
56+
uses: peter-evans/create-pull-request@v6
6057
with:
61-
title: "Update PowerApps CLI version to ${{ steps.get_latest_version.outputs.latest_version }}"
62-
content-filepath: .github/cli-update-issue-template.md
63-
labels: "automation,dependencies"
64-
assignees: "github-copilot[bot]"
65-
env:
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
commit-message: "chore: update PowerApps CLI version to ${{ steps.get_latest_version.outputs.latest_version }}"
59+
title: "chore: update PowerApps CLI version to ${{ steps.get_latest_version.outputs.latest_version }}"
60+
body: |
61+
This PR updates the PowerApps CLI version in `gulpfile.mjs` from ${{ steps.get_current_version.outputs.current_version }} to ${{ steps.get_latest_version.outputs.latest_version }}.
62+
63+
For implementation reference, see PR #1236.
64+
65+
_Automated PR generated by GitHub Actions._
66+
branch: update/cli-version-${{ steps.get_latest_version.outputs.latest_version }}
67+
delete-branch: true
68+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
69+
add-paths: |
70+
gulpfile.mjs

0 commit comments

Comments
Β (0)