-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from Azure/build-workflow-fix7
Missing Git Config
- Loading branch information
Showing
1 changed file
with
43 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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." | ||
|
||
|
@@ -31,8 +32,6 @@ jobs: | |
|
||
- name: Checkout Azure IPAM Code | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: actions/github-script@v7 | ||
id: getPullRequestData | ||
|
@@ -46,6 +45,20 @@ jobs: | |
}) | ||
).data[0]; | ||
- name: Configure Git | ||
id: configureGit | ||
run: | | ||
git config --global user.name "IPAM GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
- name: Create Temporary Branch | ||
id: createBranch | ||
env: | ||
prNumber: ${{ fromJson(steps.getPullRequestData.outputs.result).number }} | ||
run: | | ||
git checkout -b ipam-version-${prNumber} | ||
git push origin ipam-version-${prNumber} | ||
- name: "Increment Azure IPAM Version" | ||
id: updateVersion | ||
working-directory: tools | ||
|
@@ -78,7 +91,8 @@ jobs: | |
- name: Install NPM Packages | ||
id: installNpmPackages | ||
working-directory: ui | ||
run: npm install | ||
run: | | ||
npm install | ||
- name: "Create Azure IPAM ZIP Asset" | ||
id: buildZipAsset | ||
|
@@ -89,11 +103,11 @@ jobs: | |
- name: Commit Updated Azure IPAM Code | ||
id: commitCode | ||
env: | ||
prNumber: ${{ fromJson(steps.getPullRequestData.outputs.result).number }} | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git commit -a -m "Updated Azure IPAM Version" | ||
git push | ||
git push origin ipam-version-${prNumber} | ||
release: | ||
name: Create Azure IPAM Release | ||
|
@@ -106,6 +120,27 @@ jobs: | |
sparse-checkout: | | ||
assets | ||
- name: Create and Merge Pull Reuest | ||
id: pullRequest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT_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: | ||
|
@@ -126,8 +161,8 @@ jobs: | |
run: | | ||
gh release upload "$tagName" "$assetPath" | ||
update: | ||
name: Update Azure IPAM Containers | ||
build: | ||
name: Build Azure IPAM Containers | ||
runs-on: ubuntu-latest | ||
needs: [ version, release ] | ||
steps: | ||
|