Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jdk17u
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
openjdk
jdk17u
Commits
2e9152dc
Commit
2e9152dc
authored
9 months ago
by
Zdenek Zambersky
Committed by
Paul Hohensee
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
8336928: GHA: Bundle artifacts removal broken
Backport-of: 98562166e4a4c8921709014423c6cbc993aa0d97
parent
4aa7950d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/main.yml
+15
-18
15 additions, 18 deletions
.github/workflows/main.yml
with
15 additions
and
18 deletions
.github/workflows/main.yml
+
15
−
18
View file @
2e9152dc
...
@@ -344,26 +344,23 @@ jobs:
...
@@ -344,26 +344,23 @@ jobs:
-
test-windows-x64
-
test-windows-x64
steps
:
steps
:
# Hack to get hold of the api environment variables that are only defined for actions
-
name
:
'
Get
API
configuration'
id
:
api
uses
:
actions/github-script@v7
with
:
script
:
'
return
{
url:
process.env["ACTIONS_RUNTIME_URL"],
token:
process.env["ACTIONS_RUNTIME_TOKEN"]
}'
-
name
:
'
Remove
bundle
artifacts'
-
name
:
'
Remove
bundle
artifacts'
run
:
|
run
:
|
# Find and remove all bundle artifacts
# Find and remove all bundle artifacts
ALL_ARTIFACT_URLS="$(curl -s \
# See: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28
-H 'Accept: application/json;api-version=6.0-preview' \
ALL_ARTIFACT_IDS="$(curl -sL \
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
-H 'Accept: application/vnd.github+json' \
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
-H 'Authorization: Bearer ${{ github.token }}' \
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
-H 'X-GitHub-Api-Version: 2022-11-28' \
for url in $BUNDLE_ARTIFACT_URLS; do
'${{ github.api_url }}/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts')"
echo "Removing $url"
BUNDLE_ARTIFACT_IDS="$(echo "$ALL_ARTIFACT_IDS" | jq -r -c '.artifacts | map(select(.name|startswith("bundles-"))) | .[].id')"
curl -s \
for id in $BUNDLE_ARTIFACT_IDS; do
-H 'Accept: application/json;api-version=6.0-preview' \
echo "Removing $id"
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
curl -sL \
-X DELETE "$url" \
-X DELETE \
-H 'Accept: application/vnd.github+json' \
-H 'Authorization: Bearer ${{ github.token }}' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
"${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/$id" \
|| echo "Failed to remove bundle"
|| echo "Failed to remove bundle"
done
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment