Skip to content

Commit

Permalink
Updated PR number variable name in workflo
Browse files Browse the repository at this point in the history
  • Loading branch information
DCMattyG committed Feb 26, 2024
1 parent b837c76 commit 2b37547
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/azure-ipam-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
ipamVersion: ${{ steps.updateVersion.outputs.ipamVersion }}
prNumber: ${{ fromJson(steps.getPullRequestData.outputs.result).number }}
steps:
- run: echo "Job triggered by a ${{ github.event_name }} event to main."

Expand Down Expand Up @@ -53,10 +54,10 @@ jobs:
- name: Create Temporary Branch
id: createBranch
env:
branchSuffix: ${{ steps.getPullRequestData.outputs.result.number }}
prNumber: ${{ fromJson(steps.getPullRequestData.outputs.result).number }}
run: |
git checkout -b ipam-version-${branchSuffix}
git push origin ipam-version-${branchSuffix}
git checkout -b ipam-version-${prNumber}
git push origin ipam-version-${prNumber}
- name: "Increment Azure IPAM Version"
id: updateVersion
Expand Down Expand Up @@ -103,10 +104,10 @@ jobs:
- name: Commit Updated Azure IPAM Code
id: commitCode
env:
branchSuffix: ${{ steps.getPullRequestData.outputs.result.number }}
prNumber: ${{ fromJson(steps.getPullRequestData.outputs.result).number }}
run: |
git commit -a -m "Updated Azure IPAM Version"
git push origin ipam-version-${branchSuffix}
git push origin ipam-version-${prNumber}
release:
name: Create Azure IPAM Release
Expand All @@ -119,6 +120,27 @@ jobs:
sparse-checkout: |
assets
- name: Create and Merge Pull Reuest
id: pullRequest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
prNumber: ${{ needs.version.outputs.prNumber }}
run: |
gh pr create --base main --head "ipam-version-${prNumber}" --title "Update Azure IPAM Version" --body "-Updated Version to v${{ needs.version.outputs.ipamVersion }}"
gh pr merge "ipam-version-${prNumber}" -t "Merge pull request from Azure/ipam-version-${prNumber} [skip ci]" -m
- name: Pull Merged Code from Main Branch
id: pullMainCode
run: |
git pull
- name: Delete Temporary Branch
id: deleteBranch
env:
prNumber: ${{ needs.version.outputs.prNumber }}
run: |
git push origin --delete "ipam-version-${prNumber}"
- name: Publish Azure IPAM Release
id: publishRelease
env:
Expand Down

0 comments on commit 2b37547

Please sign in to comment.