Skip to content

Commit

Permalink
chore(ci): fix broken upgrade workflow (#91)
Browse files Browse the repository at this point in the history
It was still creating a new PR because of issues determining the
previous CDKTF version. This fixes it.
  • Loading branch information
xiehan authored Aug 28, 2023
1 parent ff5809e commit 56c09fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/upgrade-cdktf.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion projenrc/upgrade-cdktf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export class UpgradeCDKTF {
name: "Install",
run: "yarn install",
},
{
name: "Install examples",
run: `ls -d examples/* | xargs -I {} bash -c "cd '{}' && yarn"`,
},
{
name: "Get current CDKTF version",
id: "current_version",
Expand Down Expand Up @@ -63,9 +67,14 @@ export class UpgradeCDKTF {
if: "steps.current_version.outputs.short != steps.latest_version.outputs.short",
run: "scripts/update-cdktf.sh ${{ steps.latest_version.outputs.value }}",
},
{
name: "Check if there are any changes",
id: "get_changes",
run: `echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT`,
},
{
name: "Create draft pull request",
if: "steps.current_version.outputs.short != steps.latest_version.outputs.short",
if: "steps.get_changes.outputs.changed != 0",
uses: "peter-evans/create-pull-request@v3",
with: {
"commit-message":
Expand Down

0 comments on commit 56c09fa

Please sign in to comment.