-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update versions file automation (#4512)
* Fix missing snapshots due to not fetched branches * Improve PR description + add the version requirements to the description/commit message
- Loading branch information
Showing
2 changed files
with
10 additions
and
5 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 |
---|---|---|
|
@@ -11,6 +11,10 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# no depth limit | ||
# so, we can generate snapshot versions based on release branches | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
|
@@ -20,16 +24,17 @@ jobs: | |
- name: Set up branch | ||
run: git checkout -b update-agent-versions-$GITHUB_RUN_ID | ||
|
||
- name: Update the agent version file | ||
- name: Install mage | ||
uses: magefile/mage-action@v3 | ||
with: | ||
version: v1.13.0 | ||
args: integration:updateVersions | ||
install-only: true | ||
|
||
- name: Check for file changes | ||
- name: Update versions file | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
version_requirements=$(mage integration:updateVersions) | ||
changes=$(git status -s -uno .agent-versions.json) | ||
if [ -z "$changes" ] | ||
then | ||
|
@@ -46,7 +51,7 @@ jobs: | |
git config --global user.name 'apmmachine' | ||
git config --global user.email '[email protected]' | ||
git add ".agent-versions.json" | ||
git commit -m "[$GITHUB_REF_NAME](automation) Update .agent-versions.json" -m "This file is used for picking agent versions in integration tests. It's content is based on the reponse from https://artifacts-api.elastic.co/v1/versions/" | ||
git commit -m "[$GITHUB_REF_NAME](automation) Update .agent-versions.json" -m "This file is used for picking agent versions in integration tests.\n\nThe file's content is based on responses from https://www.elastic.co/api/product_versions and https://snapshots.elastic.co\n\nThe current update is generated based on the following requirements:\n\`\`\`json\n$version_requirements\n\`\`\`" | ||
git push --set-upstream origin "update-agent-versions-$GITHUB_RUN_ID" | ||
gh pr create \ | ||
--base "$GITHUB_REF_NAME" \ | ||
|
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