-
Notifications
You must be signed in to change notification settings - Fork 1.2k
(ddev) Dynamically update action version #31445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+172
−84
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1d96bcc
(app builder) Update tables documentation
hestonhoffman 0dfff91
wip
hestonhoffman da44c1c
wip
hestonhoffman 21c7127
(actions) Dynamic action runner versions
hestonhoffman 4ce7b73
Reset changes to content
hestonhoffman a8551e1
Better print statement
hestonhoffman 17ccc47
Remove extra print statement
hestonhoffman 54436a6
Update chainguard
hestonhoffman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
on: | ||
schedule: | ||
# At 08:00 on every day-of-week from Monday through Friday. | ||
- cron: "0 7 * * 1-5" | ||
workflow_dispatch: # allows manual trigger | ||
|
||
jobs: | ||
call-version-getter-shared-workflow: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
uses: Datadog/documentation/.github/workflows/version_getter_shared.yml@heston/dynamic-action-version | ||
with: | ||
url: https://api.datadoghq.com/api/v2/on-prem-management-service/runner/latest-image | ||
file-name: private_action_runner_version.json |
This file contains hidden or 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 |
---|---|---|
|
@@ -5,71 +5,11 @@ on: | |
workflow_dispatch: # allows manual trigger | ||
|
||
jobs: | ||
synthetics-worker-version: | ||
call-version-getter-shared-workflow: | ||
permissions: | ||
contents: write # for git push | ||
id-token: write # Needed to federate tokens. | ||
runs-on: ubuntu-latest | ||
name: Find latest synthetics-worker version | ||
steps: | ||
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3 | ||
id: octo-sts | ||
with: | ||
scope: DataDog/documentation | ||
policy: self.bump-synthetics-worker-version.create-pr | ||
|
||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: "3.11" | ||
- run: pip install requests semver defusedxml | ||
|
||
- name: Find latest synthetic-worker version | ||
id: write-synthetics-worker-version | ||
run: | | ||
python local/bin/py/version_getter.py | ||
|
||
- name: Save modified file | ||
run: | | ||
mkdir -p $RUNNER_TEMP/synthetics | ||
cp ./data/synthetics_worker_versions.json $RUNNER_TEMP/synthetics/ | ||
|
||
- name: echo new version | ||
run: echo ${{ steps.write-synthetics-worker-version.outputs.new_version }} | ||
|
||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
with: | ||
persist-credentials: true | ||
|
||
- name: Restore modified file | ||
run: | | ||
cp $RUNNER_TEMP/synthetics/synthetics_worker_versions.json ./data/ | ||
|
||
- name: Write version | ||
if: steps.write-synthetics-worker-version.outputs.new_version == 'true' | ||
run: |- | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add ./data/synthetics_worker_versions.json | ||
git commit -m "(Automated) Bump synthetics-worker version" | ||
git push -f origin HEAD:refs/heads/synthetics-worker/versions | ||
|
||
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
name: Propose change with latest versions | ||
if: steps.write-synthetics-worker-version.outputs.new_version == 'true' | ||
with: | ||
github-token: ${{ steps.octo-sts.outputs.token }} | ||
result-encoding: string | ||
script: | | ||
await github.rest.pulls.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: "(Automated) Bump synthetics-worker version", | ||
body: "### Merge instructions\n- [x] Please merge after reviewing", | ||
head: "synthetics-worker/versions", | ||
base: "master", | ||
maintainer_can_modify: true | ||
}) | ||
contents: read | ||
pull-requests: write | ||
uses: Datadog/documentation/.github/workflows/version_getter_shared.yml@heston/dynamic-action-version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto here |
||
with: | ||
url: https://ddsynthetics-windows.s3.amazonaws.com/installers.json | ||
file-name: synthetics_worker_versions.json |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
url: | ||
required: true | ||
type: string | ||
file_name: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
reusable_workflow_job: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/labeler@v5 | ||
|
||
fetch-version: | ||
permissions: | ||
contents: write # for git push | ||
id-token: write # Needed to federate tokens. | ||
runs-on: ubuntu-latest | ||
name: Find latest version | ||
steps: | ||
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3 | ||
id: octo-sts | ||
with: | ||
scope: DataDog/documentation | ||
policy: self.version_getter_shared.create-pr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will need to be updated to match the workflow otherwise it will not be able to auth |
||
|
||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: "3.11" | ||
- run: pip install requests semver defusedxml | ||
|
||
- name: Find and write latest version | ||
id: write-version | ||
run: | | ||
python local/bin/py/version_getter.py --url ${{ inputs.url }} --file-name ${{ inputs.file_name }} | ||
|
||
- name: Save modified file | ||
run: | | ||
mkdir -p $RUNNER_TEMP/temp | ||
cp ./data/{{ inputs.file_name }} $RUNNER_TEMP/temp/ | ||
|
||
- name: echo new version | ||
run: echo ${{ steps.write-version.outputs.new_version }} | ||
|
||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
with: | ||
persist-credentials: true | ||
|
||
- name: Restore modified file | ||
run: | | ||
cp $RUNNER_TEMP/temp/{{ inputs.file_name }} ./data/ | ||
|
||
- name: Write version | ||
if: steps.write-version.outputs.new_version == 'true' | ||
run: |- | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add ./data/{{ inputs.file_name }} | ||
git commit -m "(Automated) Bump version" | ||
git push -f origin HEAD:refs/heads/automatic-version-update/versions | ||
|
||
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
name: Propose change with latest versions | ||
if: steps.write-version.outputs.new_version == 'true' | ||
with: | ||
github-token: ${{ steps.octo-sts.outputs.token }} | ||
result-encoding: string | ||
script: | | ||
await github.rest.pulls.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: "(Automated) Bump version", | ||
body: "### Merge instructions\n- [x] Please merge after reviewing", | ||
head: "automatic-version-update/versions", | ||
base: "master", | ||
maintainer_can_modify: true | ||
}) | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
{ | ||
"client": "private-action-runner", | ||
"version": "1.7.0" | ||
} | ||
] |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we need a SHA here, but I might have to update this in a follow-up PR