Skip to content
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

Fix problem with using old octocat api #51

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#######################################################################
#
# Copyright (c) 2021 T-Systems International GmbH (Catena-X Consortium)
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
# See the AUTHORS file(s) distributed with this work for additional
# information regarding authorship.
#
# This work is made available under the terms of the
# Creative Commons Attribution 4.0 International (CC-BY-4.0) license,
# which is available at
# https://creativecommons.org/licenses/by/4.0/legalcode.
# See the LICENSE file(s) distributed with this work for
# additional information regarding license terms.
#
# SPDX-License-Identifier: CC-BY-4.0
#######################################################################

name: 1 Upload

Expand All @@ -26,27 +22,29 @@ jobs:
upload-models:
name: 00 Upload Models
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
steps:
- name: set environment variables
run: |
echo "WORKSPACE_UPPERCASE=INT" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Download artifact
uses: actions/[email protected]
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "output"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand All @@ -57,7 +55,6 @@ jobs:
- run: |
unzip output.zip
cat output.json

- name: Fetch Access Token
id: token_request
env:
Expand All @@ -72,13 +69,11 @@ jobs:
--data-urlencode client_id=$CLIENT_ID \
--data-urlencode client_secret=$CLIENT_SECRET )
access_token=$( echo $response | jq -r '.access_token' )

if [ $access_token == null ]
then
echo "Error: Got empty token"
exit 1
fi

echo "ACCESS_TOKEN=$access_token" >> $GITHUB_ENV

- name: Upload
Expand Down